CentOS 6.5 binary installation MySQL 5.6
--------------------------------
Download MySQL5.6 binary Package
Mysql-5.6.20-linux-glibc2.5-x86_64.tar.gz
Install dependent packages
Yum Install libaio*
Useradd MySQL
Install MySQL under/data/mysql/data
Tar zxvf mysql-5.6.20-linux-glibc2.5-x86_64.tar.gz-c/data/
MV Mysql-5.6.20-linux-glibc2.5-x86_64 MySQL
Modify all levels of MySQL folder and file creator, create the group as MySQL (note that there is one behind the statement.)
Chown-r Mysql.mysql/data/mysql
Now that MySQL is installed,
But it also requires initialization, initializing MySQL tables, test tables, infomation tables, and so on.
/data/mysql/scripts/mysql_install_db--datadir=/data/mysql/data--basedir=/data/mysql--user=mysql--explicit_ Defaults_for_timestamp
--------------------------------------------------------------------------------------------------------------- ----------------------
Copy Startup scripts
Cp/data/mysql/support-files/mysql.server/etc/init.d/mysqld
Ln-s/data/mysql/include/usr/include/mysql
echo "/data/mysql/lib" >/etc/ld.so.conf.d/mysql.conf && ldconfig-v
Ln-s/data/mysql/bin/mysql/usr/bin
Modifying a configuration file my.cnf
Cd/data/mysql
CP MY.CNF/ETC/MY.CNF
Vim/etc/my.cnf
added in [mysqld]:
Basedir =/data/mysql
DataDir =/data/mysql/data
Port = 3306
server_id = 1
-------------------------
Start the MySQL service
Chkconfig mysqld on
Service mysqld Start
Log in to MySQL and delete empty users
Mysql
Mysql> SELECT User,host,password from Mysql.user;
+------+-----------------------+----------+
| user | Host | password |
+------+-----------------------+----------+
| Root | localhost | |
| Root | Localhost.localdomain | |
| Root | 127.0.0.1 | |
| Root | :: 1 | |
| | localhost | |
| | Localhost.localdomain | |
+------+-----------------------+----------+
6 rows in Set (0.00 sec)
Set password () in parentheses for password, username root
mysql> UPDATE mysql.user Set password = password (' [email protected] ') WHERE user = ' root ';
Mysql> SELECT User,host,password from Mysql.user;
+------+-----------------------+-------------------------------------------+
| user | Host | password |
+------+-----------------------+-------------------------------------------+
| Root | localhost | *11b9aca21786f766739d0eb1483c5f64212b81ac |
| Root | Localhost.localdomain | *11b9aca21786f766739d0eb1483c5f64212b81ac |
| Root | 127.0.0.1 | *11b9aca21786f766739d0eb1483c5f64212b81ac |
| Root | :: 1 | *11b9aca21786f766739d0eb1483c5f64212b81ac |
| | localhost | |
| | Localhost.localdomain | |
+------+-----------------------+-------------------------------------------+
6 rows in Set (0.00 sec)
mysql> DROP USER ' @localhost;
mysql> FLUSH privileges;
Mysql> quit
---------------------MySQL Installation complete-------------------------------
Set/Modify Password
Mysql> Grant all privileges on * * to ' root ' @ ' localhost ' identified by ' [email protected] ' with GRANT option;
mysql> flush Privileges;
CentOS 6.5 binary installation MySQL 5.6