The CentOS 6.5 comes with MySQL 5.1 installed, but 5.1 has a lot of limitations, and in practice we've already used MySQL 5.6, which causes some scripts to execute in MySQL 5.1 with an error. We can only upgrade MySQL
 
 
 - 1Backing up the database, upgrading MySQL usually does not lose data, but for the sake of insurance, we need to do this step. Enter the command: Mysqldump-u xxx-h xxx-p 3306-p--all-databases > Databases.sql 
- 2To stop the MySQL service, enter the command: Service Mysqld Stop 
- 3To uninstall the old version of MySQL, enter the command: Yum Remove MySQL mysql-* During execution, you will be asked if you want to remove, enter "Y" at this time 
- 4After removing the command, you can see if there is any remaining MySQL, enter the command: Yum List Installed | grep MySQL If so, you can enter the command to delete: Rum Remove Mysql-libs Add: If the above method or uninstall is not clean, then refer to the following unloading method, generally can be uninstalled clean 1. Yum-style installation of MySQL 1. Yum remove MySQL mysql-server mysql-libs compat-mysql51 2, Rm-rf/var/lib/mysql
 3, RM/ETC/MY.CNF See if you have MySQL software:
 Rpm-qa|grep MySQL
 If it exists, continue with the deletion. 2, RPM-style installation of MySQL A) Check to see if MySQL is installed in the RPM package on the system: [Email protected] opt]# Rpm-qa | Grep-i MySQL
 mysql-server-5.6.17-1.el6.i686
 mysql-client-5.6.17-1.el6.i686b) Uninstall MySQL [Email protected] local]# rpm-e mysql-server-5.6.17-1.el6.i686
 [Email protected] local]# rpm-e mysql-client-5.6.17-1.el6.i686
 c) Delete MySQL service [Email protected] local]# Chkconfig--list | Grep-i MySQL
 [[email protected] local]# chkconfig--del MySQL
 d) Delete the distributed MySQL folder [[email protected] local]# Whereis MySQL or find/-name MySQL MySQL:/usr/lib/mysql/usr/share/mysql Empty all directories and files related to MySQL
 Rm-rf/usr/lib/mysql
 Rm-rf/usr/share/mysql
 Rm-rf/usr/my.cnf With these steps, MySQL should have been completely uninstalled.
- 5Download and install the latest RPM file RPM-UVH http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm 
- 6To install MySQL, enter the command: Yum Install Mysql-community-server 
- 7After the installation is complete, enter the command to view the MySQL version number: Mysql-v 
- 8To start MySQL, enter the command: Service mysqld Start Note: If we are starting the MySQL service for the first time, the MySQL server will first initialize the configuration, such as:At this point we will see that the first time you start the MySQL server will prompt a lot of information, the purpose is to initialize the MySQL database, when we restart the MySQL service again, will not prompt so much information, such as: [Email protected] ~]# service mysqld restart When we use MySQL database, we have to start the Mysqld service first, we can through Chkconfig--list | grep mysqld command to see if the MySQL service is booting automatically, such as: [[email protected] ~]# Chkconfig--list | grep mysqld
 We found that the MYSQLD service did not start automatically, we can of course chkconfig mysqld on command to set it to boot, so that you do not have to manually start each time [[email protected] ~]# chkconfig mysqld On
 [Email protected] ~]# Chkconfig--list | grep MySQL
 MySQL database after installation will only have a root administrator account, but at this time the root account has not set a password for it, the first time the MySQL service started, the database will be some initialization work, in the output of a large string of information, we see a line of information: 
 So we can use this command to set the password for our root account ( Note : This root account is the root account of MySQL, not the root account of Linux) mysqladmin-u root Password ' Root '//Use this command to set the password for the root account you want