Upgrade MySQL5.1 to MySQL5.5 in CentOS

Source: Internet
Author: User
Mysql5.5 has been released for a while, and the performance has been significantly improved, especially for multi-core CPU support and TPS performance improvement. Last week, the blogger introduced the steps for compiling and installing mysql5.5 in linux. there is no problem with installation. However, many of my friends may have been using mysql5.1 like me. now I want to upgrade my database to 5.5. The blogger records the upgrade operation based on the actual operation. Mysql basic information 1, installation directory [root @ vm-199 ~] #/Usr/local/mysq

Mysql 5.5 has been available for a while, and its performance has been significantly improved, especially for multi-core CPU support and TPS performance improvement. Last week, the blogger introduced how to compile and install mysql 5.5 in linux. there is no problem with installation. However, many of my friends may have been using mysql 5.1 like me. now I want to upgrade the database to 5.5. The blogger records the upgrade operation based on the actual operation.

Basic mysql 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. start the script
[Root @ vm-199 ~] #/Etc/init. d/mysql

Backup data and installation and configuration files

[Root @ vm-199 ~] # Mysqldump-uroot-p? All-databases[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 ./

After the data is backed up, close the mysql database,/etc/init. d/mysql stop, and delete the/usr/local/mysql file.

Install mysql 5.5

Specific can refer to this article "Linux compilation and installation of Mysql-5.5 simple steps" (http://www.sijitao.net/1563.html), installation directory, Data Directory and 5.1 is the same, are/usr/local/mysql.

Update configuration file

[Root @ vm-199] # cp support-files/mysql-5.5.35/etc/my. cnf

Add the data directory datadir =/data/mysql to the configuration file.

Start mysql 5.5, execute the update program, and restart mysql

[root@vm-199 mysql-5.5.35]# /etc/init.d/mysql start[root@vm-199 mysql-5.5.35]# /usr/local/mysql/bin/mysql_upgradeLooking for 'mysql' as: /usr/local/mysql/bin/mysqlLooking for 'mysqlcheck' as: /usr/local/mysql/bin/mysqlcheckRunning 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysqld.sock'Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysqld.sock'mydb.t1 OKmydb.t2 OKmysql.columns_priv OKmysql.db OKmysql.event OKmysql.func OKmysql.general_log OKmysql.help_category OKmysql.help_keyword OKmysql.help_relation OKmysql.help_topic OKmysql.host OKmysql.ndb_binlog_index OKmysql.plugin OKmysql.proc OKmysql.procs_priv OKmysql.proxies_priv OKmysql.servers OKmysql.slow_log OKmysql.tables_priv OKmysql.time_zone OKmysql.time_zone_leap_second OKmysql.time_zone_name OKmysql.time_zone_transition OKmysql.time_zone_transition_type OKmysql.user OKRunning 'mysql_fix_privilege_tables'...OK

So far, mysql has been updated. Log on to mysql and check whether the data is the same as the original one.

This mysql upgrade is not complicated. In fact, it is to reinstall it and overwrite the data directory file. However, during database upgrade, you must 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.