CentOS the steps to upgrade MySQL 5.1 to MySQL 5.5 _mysql

Source: Internet
Author: User

MySQL 5.5 has been out for a while, performance has been significantly improved, especially for multi-core CPUs and the improvement of TPS performance. Last week, the blogger introduced Linux to compile and install MySQL 5.5 steps, install no accident basically no problem. But maybe a lot of friends and I have been using MySQL 5.1, now want to upgrade the database to 5.5. Bloggers according to the actual operation, record the upgrade operation.

MySQL basic information

1, installation directory
[root@vm-199~]#/usr/local/mysql
2. Configuration file
[root@vm-199~]#/etc/my.cnf
3, Data Directory
[root@vm-199~]#/data/mysql
4. Startup script
[root@vm-199~]#/etc/init.d/mysql

Backing up data and installation, configuration files

[root@vm-199~]# mysqldump-uroot-p–all-databases </root/zhangnq/mysql5.1/mysql_dbk_20140217.sql
[root@vm-199~]# tar czvf mysql_5.1.60_full.tar.gz/usr/local/mysql
[root@vm-199~]# tar czvf mysql_5.1.60_data_full.tar.gz/data/mysql
[root@vm-199~]# cp/etc/my.cnf./

Close MySQL database after data backup,/etc/init.d/mysql stop, delete/usr/local/mysql file.

Install MySQL 5.5

Concrete can refer to this article "Linux compile installation Mysql-5.5 simple steps", installation directory, data directory and 5.1 of the same, are/usr/local/mysql.

Update configuration file

[root@vm-199 mysql-5.5.35]# CP support-files/my-huge.cnf/etc/my.cnf

Add a data directory to the configuration file, DataDir =/data/mysql.

Start MySQL 5.5, perform the update and restart MySQL

Copy Code code as follows:

[root@vm-199 mysql-5.5.35]#/etc/init.d/mysql start
[root@vm-199 mysql-5.5.35]#/usr/local/mysql/bin/mysql_upgrade
Looking for ' MySQL ' as:/usr/local/mysql/bin/mysql
Looking for ' Mysqlcheck ' as:/usr/local/mysql/bin/mysqlcheck
Running ' Mysqlcheck ' with connection arguments: '--port=3306 ' '--socket=/tmp/mysqld.sock '
Running ' Mysqlcheck ' with connection arguments: '--port=3306 ' '--socket=/tmp/mysqld.sock '
Mydb.t1 OK
Mydb.t2 OK
Mysql.columns_priv OK
Mysql.db OK
Mysql.event OK
Mysql.func OK
Mysql.general_log OK
Mysql.help_category OK
Mysql.help_keyword OK
Mysql.help_relation OK
Mysql.help_topic OK
Mysql.host OK
Mysql.ndb_binlog_index OK
Mysql.plugin OK
Mysql.proc OK
Mysql.procs_priv OK
Mysql.proxies_priv OK
Mysql.servers OK
Mysql.slow_log OK
Mysql.tables_priv OK
Mysql.time_zone OK
Mysql.time_zone_leap_second OK
Mysql.time_zone_name OK
Mysql.time_zone_transition OK
Mysql.time_zone_transition_type OK
Mysql.user OK
Running ' Mysql_fix_privilege_tables ' ...
Ok

MySQL has been updated so far. Log in to MySQL and check to see if the data is the same.

This MySQL upgrade is not complicated, in fact, is to reinstall again, and then the data directory file cover. However, the database upgrade, the main need to pay attention to data backup, to prevent data and accidental loss.

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.