Overview: MySQL is popular for its light, open source, free features, and MySQL's wide range of usage data. In this paper, the installation of mysql-5.6.12 (*.tar.gz) in the CentOS environment is used as an example to record the details of installing MySQL under Linux for reference only.
1, download the specified version of the MySQL installation files (official website: http://mysql.com/downloads, you can also use wget), and then copy to, home.
2. Unzip the MySQL file
#cd/Home
#tar-ZXVF mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
Copy the MySQL file to/usr/local
#cp-rf/home/mysql-5.6.12-linux-glibc2.5-x86_64/usr/local/mysql5.6
3. Create MySQL groups and users
#groupadd MySQL
#useradd-G MySQL MySQL
4. Installation
Go to MySQL Directory
#cd/usr/local/mysql5.6
Initializing the database
#scripts/mysql_install_db--user=mysql
Modify the owner of a file
#chown Root.
Modify the owner of the Data folder
#chown-R MySQL Data
Change user groups
#chgrp-R MySQL.
Start MySQL
#cd/usr/local/mysql5.6
#bin/mysqld_safe--user=mysql &
5. Add MySQL to the system service
#cp-rf/usr/local/mysql5.6/support-files/mysql.server/etc/init.d/mysqld
#cd/etc/init.d/
#chkconfig--add mysqld
#chkconfig mysqld on
6. View MySQL Status
#service mysqld Status
7. Authorized Remote Access
GRANT all privileges on * * to ' root ' @ '% ' identified by ' Youpassword ' with GRANT OPTION;
FLUSH privileges;
8. Modify User Password
Update user Set Password = password (' 123456 ') where user = ' root ';
FLUSH privileges;
If you are reporting the error of can ' t connect to local MySQL server through socket '/tmp/mysql.sock ', check if there is a Mysql.sock file under TMP and authorize the file. Modify the My.cnf file below/usr/local/mysql and change the socket to/tmp/mysql.sock.
MySQL installation under Linux