The approximate steps are:
Add the configuration file: Skip-grant-tables parameters, upgrade the Basedir into a new version, start MySQL, execute the command: Mysql_upgrade upgrade the dictionary information, and then flush privileges; Refresh the authorization table, Note: If you are using shared table space, it is best to export the data to the new version and use the Mysql_upgrade upgrade if you are using a standalone tablespace. Such as:
1. Shell > Service mysqld Stop #把实例停掉
Copy Code code as follows:
Shell > Mv/usr/local/mysql/usr/local/mysql.bak #把mysql5 5.x Old Basedir renamed as backup directory
Shell > Cp-ar/data/mysql3306/data/mysql3306.bak The instance data under 5.x to be backed up to avoid an accident during the upgrade process.
Shell > Tar VF xxx.tar.gz-c/usr/local #把mysql5 6.x binary package to the Basedir path, where mysql5.6.27 version is used, download address: wget http:// Mirrors.sohu.com/mysql/mysql-5.6/mysql-5.6.28-linux-glibc2.5-x86_64.tar.gz
Shell > cd/usr/local/
Shell > ln-s mysql-5.6.28-linux-glibc2.5-x86_64 mysql #创建软连接
Shell > \cp-ar/usr/local/mysql.bak/my.cnf/usr/local/mysql/#把旧版basedir下的配置文件复制回来, if your profile is not under Basedir, then there's no need to move.
2. Add under mysqld of configuration file: Skip-grant-tables option:
3.shell > Service mysqld start #启动更新basedir之后的实例
4. Using the Mysql_upgrade command: Checking for incompatible tables, updating the grant table
Shell > Mysql_upgrade-p3306-u root-p ' xx ' #命令输出除了warning外, the table check must be OK, and then log in to MySQL (log in as prompted to see the new version number),
MySQL > Flush privileges;
5. Remove the skip-grant-tables from the configuration file
6. To see if there is any error log errors, at this point can verify the data is abnormal, no exception to indicate that the upgrade was successful
Note: Upgrade can not skip, that is 5.1 to upgrade to 5.6, you must first upgrade to 5.5; After all steps are completed, it is best to restart the mysqld