1. Enter the command to query the system for the installed MySQL
2.. Uninstall MySQL individually
Yum Remove system displays the installed MySQL
For example: Yum remove mysql-client-5.6.33-1.linux_glibc2.5.x86_64
3. Use the Find command to find the MySQL folder that exists on the system after the uninstallation is complete
4. Delete the folder path individually using the RM-RF command
For example: Rm-rf/etc/rc.d/init.d/mysql
5. Install MySQL
RPM-IVH mysql-client-5.6.33-1.linux_glibc2.5.x86_64.rpm
RPM-IVH mysql-server-5.6.33-1.linux_glibc2.5.x86_64.rpm
6. Modify the configuration file
Cp/usr/share/mysql/my-default.cnf/etc/my.cnf
7. Initialize MySQL and set password
/usr/bin/mysql_install_db
Service MySQL Start
Cat/root/.mysql_secret #查看root账号密码
Mysql-u ROOT–PQKTAFZNL
mysql> SET PASSWORD = PASSWORD (' 123456 '); #设置密码为123456
Mysql> exit
8. Setting up remote access
Grant all privileges in . to ' root ' @ ' percent ' identified by ' 123456 ';
Flush privileges;
9. Set up boot from boot
Add to System services:
Chkconfig--add MySQL
Auto Start:
Chkconfig MySQL on
Query list:
Chkconfig
CentOS RPM Mode installation MySQL5.6