Centos 6.7 Installation MySQL 5.7.12

Source: Internet
Author: User

Late at night, the reason to write this article is really because a lot of time today wasted on this MySQL installation, originally very simple process, but almost wasted a day of time.

First, Mysql installation and startup

Preparatory work

(1) Create a user

useradd-s/sbin/nologin-m mysql

(2) Create a MySQL directory

mkdir-p/data/mysql

(3) Directory owner

chown-r Mysql/data/mysql


1. Download the latest MySQL

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/82/3E/wKiom1dPJz-T48UTAAE9Eth5r90711.jpg-wh_500x0-wm_3 -wmp_4-s_1132967609.jpg "title=" qq20160602021923.jpg "alt=" Wkiom1dpjz-t48utaae9eth5r90711.jpg-wh_50 "/>

2. File transfer to CentOS/usr/local/src/

3. Unzip MySQL, move

TAR-ZXVF mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz

MV Mysql-5.7.12-linux-glibc2.5-x86_64/usr/local/mysql

4. Configuration files and replication of startup files

cp/usr/local/mysql/support-files/my-default.cnf/etc/my.cnf

Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

5. Modify the configuration file

vim/etc/my.cnf

Basedir =/usr/local/mysql

DataDir =/data/mysql

6. Start MySQL

/etc/init.d/mysqld start

Ii. problems that may be encountered

starting MySQL... ERROR! theserver quit without updatingPIDfile ...

(1) The /etc/my.cnf configuration file may be used when MySQL does not specify a configuration file.

cp/usr/local/mysql/support-files/my-default.cnf/etc/my.cnf

Please open this file to see if there is a specified data directory (DATADIR) under [mysqld ].

WORKAROUND: Please set this line under [mysqld]: DataDir =/data/mysql

(2) may be/data/mysql data directory MySQL user does not have permission

chown-r Mysql/data/mysql


Centos 6.7 Installation MySQL 5.7.12

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.