
In this post I would like to share my experience in upgrading the wonderful Percona Server (based on Oracle MySQL) from version 5.6 to version 5.7.
As you probably already know, the stable release of Oracle MySQL 5.7 has already been released, and after it, an improved version of Percona has been released. If you want to see a list of improved features (Percona Server compared to Oracle), then you should visit:
https://www.percona.com/software/mysql-database/percona-server/feature-comparison .
The list of new features of MySQL 5.7 is generally located here:
https://dev.mysql.com/doc/refman/5.7/en/mysql-nutshell.html .
So, on the topic: how to make a painless upgrade?
Next, I will list the rakes that I stepped on in this process.
Apparmor
If you are using Apparmor (enabled by default in Ubuntu), you need to add the following two lines to
/etc/apparmor.d/usr.sbin.mysqld :
/var/run/mysqld/mysqld.sock.lock rw,
/run/mysqld/mysqld.sock.lock rw,
The second option is to disable Apparmor for MySQL altogether:
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
Configuration
- If you have binlog enabled, you must assign the server-id variable. In addition, in MySQL 5.7, the default value of the sync_binlog variable is 1, which means synchronization with the disk during each transaction. If you want to leave the default behavior of version 5.6, set sync_binlog = 0 . If you do not do this, you will get a significant load on the disks. By the way, now the default binlog format is ROW , if that doesn't suit you, specify binlog_format = 'STATEMENT' .
- Also a major change was made to SQL mode: hard checks are enabled by default. Most likely, after the upgrade, most of your applications will stop working (at least it happened to me). To save the old mode of operation, specify the variable: sql_mode = "NO_ENGINE_SUBSTITUTION" .
After upgrade
As usual, it is recommended to run the
mysql_upgrade command, which will update the system database and check for compliance with all other databases on the server.
As usual, it is recommended to perform an upgrade on a test server, look at the results and then roll out to the working servers.
Successful upgrades!