Upgrading process from MySQL5.1 to MySQL5.5 in Linux CentOS6 environment

888u

Last update at :2024-06-20,Edit by888u

Snail today is helping a friend's blog move to another VPS host environment. The environment uses the LLSMP architecture. The original server uses the LNMP website environment, and the blog program is WORDPRESS. Notice that the error message "Unknown collation: \'utf8mb4_unicode_ci\'\\" appears when importing the database. This problem should only appear after WordPress version 4.2. I remember that such a problem has not occurred before.

Seeing the official WordPress community documents, it was mentioned that the problem is caused by the MYSQL version. Because the default MYSQL in the LLSMP environment is version 5.1, and the MYSQL installed in the LNMP environment is version 5.5, so the higher version does not transfer to the lower version. Compatible, the official recommendation is to upgrade MYSQL version 5.5, so I also adopt this method.

First, back up database and website files

Before doing anything, we still need to back up the database and web page files locally to avoid problems that may affect the current environment and the operation of other websites.

Second, stop MYSQL from running and uninstall the old version

service mysqld stop #Pause MYSQL

yum remove mysql mysql-* #Uninstall the old version of MYSQL

Through the above command, we first stop the current running of MYSQL, and then uninstall the old MYSQL5.1 version database.

Third, check and uninstall remaining mysql-libs

yum list installed | grep mysql

We check whether there are residual mysql-libs. If there are, we execute the following command to clear them out.

yum remove mysql-libs

Perform cleanup. If not, it doesn’t matter.

Fourth, upgrade and install MYSQL5.5

Here, Snail refers to a quick solution on the Internet. Since he has to go out to do errands later, he will not choose the version to install in this article, and directly use the 5.5 default installation in the source package.

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpmrpm -Uvh http://mirrors.neusoft.edu.cn/epel /6/i386/epel-release-6-8.noarch.rpmrpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpmrpm - Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noarch.rpmrpm -Uvh http://rpms.famillecollet.com/enterprise/remi- release-6.rpm

First install some dependent environments.

yum –enablerepo=remi,remi-test info mysql mysql-server

Then install MYSQL5.5

yum –enablerepo=remi,remi-test install mysql mysql-server

Execution completed. So far, we can check that the MYSQL version is 5.5 through mysql -V, but it is not working now. We need to configure the configuration file according to the prompts, but I don’t understand why Snail can execute it without modifying the MYSQL configuration file. Is it God’s will?

Fifth, startup and inspection

mysql_upgrade -u root -p

Originally, according to the method on the Internet, the configuration file needs to be modified. I can complete it without modifying it, so I continue to execute the upgrade startup, enter our original MYSQL ROOT password, and go through it again.

After completion, we execute to start MYSQL

service mysqld restart

If you can see two green OKs, then everything is fine.

In summary, this way we will not have coding problems when importing the database. I saw a document mentioning that you can directly select the version when exporting the MYSQL database. I will give it a try later, because there is a lot of uneasiness and trouble in upgrading MYSQL, and it will be troublesome if something goes wrong.

Recommended site search: Hong Kong's best virtual host, free cloud server, Korean server rental, registered cn domain name, website domain name registration, Hong Kong virtual host space, dynamic IP vps, Dongwang host domain name registration, IP query,

p>

Upgrading process from MySQL5.1 to MySQL5.5 in Linux CentOS6 environment

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码