2.解压新版mysql
[root@HE3 ~]# tar xvf mysql-5.7.15-linux-glibc2.5-x86_64.tar.gz
[root@HE3 ~]# mv mysql-5.7.15-linux-glibc2.5-x86_64 /usr/local/mysql
[root@HE3 ~]# chown -R mysql. /usr/local/mysql
3.替换新版mysqld启动脚本
[root@HE3 ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
cp: overwrite `/etc/init.d/mysqld'? y
开始升级
Part1:启动
[root@HE3 ~]# /etc/init.d/mysqld start
Starting MySQL..... SUCCESS!
[root@HE3 ~]# ps -ef|grep mysql
root 26467 1 0 20:30 pts/2 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql --pid-file=/data/mysql/HE3.pid
mysql 27197 26467 4 20:30 pts/2 00:00:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/error.log --open-files-limit=8192 --pid-file=/data/mysql/HE3.pid --socket=/tmp/mysql.sock --port=3306
root 27235 25656 0 20:31 pts/2 00:00:00 grep mysql
这里虽然启动成功了,但error日志里能捕捉到很多错误信息,因为没有升级字典,诸如:
2016-10-20T03:30:27.375466Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_program' has the wrong structure
2016-10-20T03:30:27.375506Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_current' has the wrong structure
2016-10-20T03:30:27.375536Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_history' has the wrong structure
2016-10-20T03:30:27.375568Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_history_long' has the wrong structure
2016-10-20T03:30:27.375598Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_thread_by_event_name' has the wrong structure
Part2:系统表升级
1.升级数据字典
[root@HE3 ~]# /usr/local/mysql/bin/mysql_upgrade -uroot -pMANAGER
mysql_upgrade: [Warning] Using a password on the command line interface can be insecure.
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.
helei.helei OK
sys.sys_config OK
Upgrade process completed successfully.
Checking if update is needed.
2.重启实例再次检查error日志
[root@HE3 ~]# /etc/init.d/mysqld restart
Shutting down MySQL.. SUCCESS!
Starting MySQL. SUCCESS!