How to upgrade Mysql5 to Mysql5.5, and mysql5 to mysql5.5

Source: Internet
Author: User

How to upgrade Mysql5 to Mysql5.5, and mysql5 to mysql5.5

Install the 5.5 dependency installation package

The Code is as follows:

yum install -y autoconf* automake* zlib* libxml* ncurses-devel* libgcrypt* libtool* openssl*

Install cmake

The Code is as follows:

yum install -y cmake

Before upgrading, we recommend that you back up the mysql and database directories of the previous 5.1 versions.

Stop mysql

The Code is as follows:

service mysql stop

Upgrade mysql 5.5.36

The Code is as follows:

http://download.csdn.net/download/cike121272604/6943279tar xf mysql-5.5.36.tar.gzcd mysql-5.5.36cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DMYSQL_DATADIR=/usr/local/mysql/var -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_USER=mysql -DEXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1make && make install

Delete the my. cnf configuration file under/etc/

The Code is as follows:

rm -rf /etc/my.cnf

Copy the 5.5 configuration file

The Code is as follows:

cp support-files/my-huge.cnf /etc/my.cnf

Try to start

The Code is as follows:

service mysql start

Execute the update program and restart mysql

The Code is as follows:

/usr/local/mysql/bin/mysql_upgrade

If it is okay all the way, but if an error occurs, please refer to my other article about mysql5.5 mysql_upgrade failure during upgrade.

View the current mysql version

The Code is as follows:

cat mysql_upgrade_info

Now, the upgrade is complete.

See solution to the upgrade failure.

Execute/usr/local/mysql/bin/mysql_upgrade during mysql5.5 upgrade.

Tip:

The Code is as follows:

Looking for 'mysql' in: /usr/local/mysql/bin/mysqlLooking for 'mysqlcheck' in: /usr/local/mysql/bin/mysqlcheckRunning 'mysqlcheck'.../usr/local/mysql/bin/mysqlcheck: Got error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOR UPGRADE' at line 1 when executing 'CHECK TABLE ... FOR UPGRADE'FATAL ERROR: Upgrade failed

It seems that 5.1 had a password! Try another method here

The Code is as follows:

/usr/local/mysql/bin/mysql_upgrade -S /var/data/mysql.sock -uroot -p

This is not enough. I suddenly thought of an amazing trick. I still use the 5.5 binary program and then change the startup parameter, because I only want to upgrade the table structure under the data Directory, the required parameter is only the data directory, so I tried the following:

# Enable the -- skip-grant-tables parameter to avoid checking. Enable it first.

The Code is as follows:

/usr/local/mysql/bin/mysqld --datadir=/usr/local/mysql/var/ --user=mysql --skip-grant-tables &

# It looks successful

# Some innodb errors are reported in the middle. Ignore them. It should be the configuration or the problem in the semi-yin and semi-yang state. This will be solved later.

# Stop the mysqladmin shutdown service and start the mysqld service with the normal parameters ...... Modify the configuration parameters in my. cnf to suit mysql5.5.

Summary:

The Code is as follows:

/usr/local/mysql/bin/mysqld --datadir=/usr/local/mysql/var/ --user=mysql --skip-grant-tables &
Articles you may be interested in:
  • How to install MySQL 6.2 in CentOS 5.5
  • To upgrade MySQL 5.1 to MySQL 5.5 in CentOS
  • Follow these steps to upgrade mysql version 5.5.x to 5.6.x

Related Article

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.