STEP1: Check whether the system comes with the installation of MySQL
# yum list installed | grep mysql
STEP2: Delete the system's own MySQL and its dependencies
Command:
# yum -y remove mysql-libs.x86_64
STEP3: Download mysql-5.7.14-linux-glibc2.5-x86_64.tar.gz
STEP4: Unzip the mysql-5.7.14-linux-glibc2.5-x86_64.tar.gz and rename it to MySQL and put it in the/usr/local directory
STEP5:
Add MySQL users and groups, then install MySQL and start, the initial password is saved by/root/.mysql_secret, using the following command:
Groupadd MySQL
Useradd mysql-g MySQL
Cd/usr/local/mysql/bin
Yum Install Libaio
./mysql_install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data
Cd/usr/local/mysql/support-files
./mysql.server Start
STOP6:
Log in to MySQL with the initial password and change the password while setting root to connect remotely
The command is as follows:
Cat/root/.mysql_secret
Cd/usr/local/mysql/bin
./mysql-u Root-p
Set Password =password (' new password ');
GRANT all privileges on * * to [email protected] '% ' identified by ' 1 new password ';
Flush privileges;
may not connect remotely, try to shut down the firewall, the command is as follows:
Service Iptables Stop
Setenforce 0
Step 7:
SR sets MySQL to boot and adds a soft connection
The command is as follows:
cd/usr/local/mysql/support-files/
CP MYSQL.SERVER/ETC/INIT.D
Cd/etc/init.d
MV Mysql.server mysqld
Cd/usr/bin
Ln-s/usr/local/mysql/bin/mysql MySQL
Reference:
Http://jingyan.baidu.com/article/e5c39bf5aa60f639d7603316.html
Http://wenku.baidu.com/link?url=pyNWlzvD9_E-PSupm34oC0DwsZ_ Zxsrlibvagcioruaueajqvdbqqkw912bypwcxpgip9eiwsxvx9cqtzswxvsu3zywnnzffrvmbazjljvg
CentOS 6.7 Installation MySQL 5.7