How to upgrade MySQL On Debian and Ubuntu

Source: Internet
Author: User
Tags linux mint
One of the daily work of the system administrator is to upgrade the service, add a patch for the service or upgrade some fancy functions. In early 2013, the latest MySQL5.6 was released with the goal of providing more

One of the daily work of the system administrator is to upgrade the service, add a patch for the service or upgrade some fancy functions. In early 2013, the latest MySQL 5.6 was released with the goal of providing more

One of the daily work of the system administrator is to upgrade the service, add a patch for the service or upgrade some fancy functions. In early 2013, the latest MySQL 5.6 was released with the goal of providing better performance and scalability. If you are interested in this, you can see how I updated MySQL On Debian and Ubuntu.

In this tutorial, I will assume that you have installed MySQL through apt-get. At the time of writing this article, MySQL 5.5 was deployed on most Linux distributions. Here I will show you how to upgrade from MySQL 5.5 to 5.6.

Step 1: Back up the MySQL configuration file. $ Sudo mkdir/backup $ sudo tar cvfvz/backup/mysql_conf.tgz/etc/mysql Step 2: export the database to one. SQL file, and back up the data under the Data Storage path. $ Sudo sh-c 'mysqldump-u root-p-A -- events>/backup/backup_db. SQL $ sudo tar cvfvz/backup/mysql_data.tgz/var/lib/mysql

Note: If you provide continuous backup for your online MySQL system, we strongly recommend that you use the single transaction option when performing the preceding steps, or explicitly use the lock (to ensure data consistency-annotation). For more information, see this tutorial.

Step 3: stop MySQL service $ sudo service mysql stop Step 4: uninstall MySQL package $ sudo apt-get remove mysql-server mysql-client mysql-common $ sudo apt-get autoremove $ sudo apt-get autoclean

Do not use the purge option when uninstalling with apt-get. This will delete the MySQL configuration file and other data that will be used later.

Step 5: Install the MySQL dependency package (Kernel Asynchronous IO access library). MySQL 5.5 and later versions depend on it. $ Sudo apt-get install libaio1 Step 6: Download the MySQL package for Debian from the official website

32-bit system:

$ Wget

64-bit system:

$ Wget Step 7: Install the MySQL package $ sudo dpkg-I mysql-5.6.15-debian6.0-*. deb

This package will be installed under the/opt/mysql directory.

Step 8: add the PATH of the MySQL command to the PATH of the system environment variable.

On Debian:

$ Sudo sh-c 'echo "PATH = $ PATH:/opt/mysql/server-5.6/bin">/etc/profile '$ source/etc/profile

On Ubuntu or Linux Mint:

$ Sudo sh-c 'echo "PATH =$ {PATH }: /opt/mysql/server-5.6/bin ">/etc/environment '$ source/etc/environment Step 9: Enter the MySQL configuration file and modify the following two lines of configuration. $ Sudo vi/etc/mysql/my. cnf

Basedir =/opt/mysql/server-5.6

Lc-messages-dir =/opt/mysql/server-5.6/share

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.