Follow these steps to upgrade mysql version 5.5.x to 5.6.x: 5.5.x5.6.x

Source: Internet
Author: User

Follow these steps to upgrade mysql version 5.5.x to 5.6.x: 5.5.x5.6.x

The general steps are as follows:

Add the skip-grant-tables parameter to the configuration file, upgrade basedir to a new version, start mysql, run the command mysql_upgrade to upgrade dictionary information, and then flush privileges; refresh the authorization table. Note: if you are using a shared tablespace, it is best to export the data and then import the new version. If you are using an independent tablespace, you can use mysql_upgrade for upgrade. For example:

1. shell> service mysqld stop # stop the instance

Copy codeThe Code is as follows:
Shell> mv/usr/local/mysql. bak # change the old basedir of mysql5.5.x to the backup directory
Shell> cp-ar/data/mysql3306/data/mysql3306.bak # back up the instance data under mysql5.5.x to avoid exceptions during the upgrade process
Shell> tar vf xxx.tar.gz-C/usr/local # extract the Binary Package of mysql5.6.x to the basedir path, Here mysql5.6.27 version is used,: 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 # create a soft connection
Shell> \ cp-ar/usr/local/mysql. bak/my. cnf/usr/local/mysql/# copy the configuration file under the old basedir version back. If your configuration file is not under basedir, do not change it here.

2. Add the skip-grant-tables option under mysqld in the configuration file:

3. shell> service mysqld start # start the instance after updating basedir

4. Run the mysql_upgrade command to check incompatible tables and update the grant table.

Shell> mysql_upgrade-P3306-u root-p 'xx' # except for the warning command output, the table check must be OK, then log on to mysql (the new version number is displayed upon logon ),
Mysql> flush privileges;

5. Remove skip-grant-tables from the configuration file.

6. check whether there are any errors in the error log. In this case, you can verify whether the data is abnormal. If no exception exists, the upgrade is successful.

Note: The upgrade cannot be skipped. To upgrade 5.1 to 5.6, you must first upgrade to 5.5. After all steps are completed, you are advised to restart mysqld.

Articles you may be interested in:
  • Centos 6.3 upgrades Mysql 5.1.61 to mysql 5.6.19. Problems and Solutions
  • How to install MySQL 6.2 in CentOS 5.5
  • To upgrade MySQL 5.1 to MySQL 5.5 in CentOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.