MySQL 5.6 upgrade 5.7 steps

Upgrade steps:

1. Full database backup for mysql5.6 (*****) for failback
 2. Close MySQL 5.6 database
 3. Deploy mysql5.7 software
 4. Modify configuration information
 5. Modify startup script
 6. Start mysql5.7 database
 7. MySQL upgrade database related parameters
 8. Restart the database and test the upgrade results

First, the database is backed up physically, using Percona Xtrabackup
Close 5.6 database
Install the binary installation package of 5.7
Modify / etc/profile to change the environment variable to point to 5.7. Execute source /etc/profile to take effect
Edit the system startup file of 5.7

[Unit]
Description=MySQL Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
ExecStart=/data/app/mysql/bin/mysqld --defaults-file=/mysql/3306/my.cnf
LimitNOFILE = 5000

Start database
systemctl start mysqld
Use MySQL upgrade to check

[root@db01 ~]# mysql_upgrade -S /mysql/mysql.sock
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.engine_cost                                  OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.gtid_executed                                OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.server_cost                                  OK
mysql.servers                                      OK
mysql.slave_master_info                            OK
mysql.slave_relay_log_info                         OK
mysql.slave_worker_info                            OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Upgrading the sys schema.
Checking databases.
sys.sys_config                                     OK
world.city                                         OK
world.country                                      OK
world.countrylanguage                              OK
Upgrade process completed successfully.
Checking if update is needed.

Restart database

[root@db01 ~]# systemctl restart mysqld
[root@db01 ~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      8902/sshd           
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      8912/postmaster     
tcp6       0      0 :::3306                 :::*                    LISTEN      10347/mysqld        
tcp6       0      0 :::22                   :::*                    LISTEN      8902/sshd           
tcp6       0      0 ::1:5432                :::*                    LISTEN      8912/postmaster     

Tags: MySQL Database network

Posted on Tue, 05 May 2020 00:59:18 -0400 by danscreations