【1】mysql版本升级(5.6升级到5.7)

时间:2019-08-06
本文章向大家介绍【1】mysql版本升级(5.6升级到5.7),主要包括【1】mysql版本升级(5.6升级到5.7)使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
--停止mysql
/etc/init.d/mysqld stop
 
--解除5.6链接
[root@mysql02 local]# unlink mysql
[root@mysql02 local]# ll
总用量 951200
drwxr-xr-x. 2 root root 4096 9月 23 2011 bin
drwxr-xr-x. 2 root root 4096 9月 23 2011 etc
drwxr-xr-x. 2 root root 4096 9月 23 2011 games
drwxr-xr-x. 2 root root 4096 9月 23 2011 include
drwxr-xr-x. 2 root root 4096 9月 23 2011 lib
drwxr-xr-x. 2 root root 4096 9月 23 2011 lib64
drwxr-xr-x. 2 root root 4096 9月 23 2011 libexec
drwxr-xr-x. 12 root mysql 4096 7月 14 18:14 mysql-5.6.44-linux-glibc2.12-x86_64
-rw-r--r--. 1 root root 329105487 6月 9 21:55 mysql-5.6.44-linux-glibc2.12-x86_64.tar.gz
-rw-r--r--. 1 root root 644869837 5月 19 22:59 mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz
drwxr-xr-x. 2 root root 4096 9月 23 2011 sbin
drwxr-xr-x. 5 root root 4096 7月 9 06:03 share
drwxr-xr-x. 2 root root 4096 9月 23 2011 src
 
--创建5.7的链接
[root@mysql02 local]# ln -s mysql-5.7.26-linux-glibc2.12-x86_64 mysql
[root@mysql02 local]# ll
总用量 951204
drwxr-xr-x. 2 root root 4096 9月 23 2011 bin
drwxr-xr-x. 2 root root 4096 9月 23 2011 etc
drwxr-xr-x. 2 root root 4096 9月 23 2011 games
drwxr-xr-x. 2 root root 4096 9月 23 2011 include
drwxr-xr-x. 2 root root 4096 9月 23 2011 lib
drwxr-xr-x. 2 root root 4096 9月 23 2011 lib64
drwxr-xr-x. 2 root root 4096 9月 23 2011 libexec
lrwxrwxrwx. 1 root root 35 7月 17 21:46 mysql -> mysql-5.7.26-linux-glibc2.12-x86_64
drwxr-xr-x. 12 root mysql 4096 7月 14 18:14 mysql-5.6.44-linux-glibc2.12-x86_64
-rw-r--r--. 1 root root 329105487 6月 9 21:55 mysql-5.6.44-linux-glibc2.12-x86_64.tar.gz
drwxr-xr-x. 9 root root 4096 7月 17 21:46 mysql-5.7.26-linux-glibc2.12-x86_64
-rw-r--r--. 1 root root 644869837 5月 19 22:59 mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz
drwxr-xr-x. 2 root root 4096 9月 23 2011 sbin
drwxr-xr-x. 5 root root 4096 7月 9 06:03 share
drwxr-xr-x. 2 root root 4096 9月 23 2011 src
 
--升级
[root@mysql02 bin]# mysql_upgrade -u root -p
Enter password:
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
 
 
--登陆
[root@mysql02 bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.26-log MySQL Community Server (GPL)
 
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
 
--在生产环境当中只需要升级系统表即可
mysql_upgrade -u root -p -s --force

$flag 上一页 下一页