mysql5.6怎么升级到mysql5.7
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,mysql5.6怎么升级到mysql5.7,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。1、停止mysql5.6数据库服务[root@h
千家信息网最后更新 2026年11月02日mysql5.6怎么升级到mysql5.7
mysql5.6怎么升级到mysql5.7,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
1、停止mysql5.6数据库服务
[root@host2 mysql]# /etc/init.d/mysqld stopShutting down MySQL.. [ OK ][root@host2 mysql]#
2、进入/usr/local更换软连接指定到mysql5.7
[root@host2 local]# lsbin games lib libexec mysql mysql-5.7.16-linux-glibc2.5-x86_64 mysql-utilities-1.6.5.tar.gz shareetc include lib64 my.cnf mysql-5.6.34-linux-glibc2.5-x86_64 mysql-utilities-1.6.5 sbin src[root@host2 local]# unlink mysql
创建新的链接
[root@host2 local]# ln -s mysql-5.7.16-linux-glibc2.5-x86_64 mysql[root@host2 local]# lltotal 712drwxr-xr-x. 2 root root 4096 Jun 28 2011 bindrwxr-xr-x. 2 root root 4096 Jun 28 2011 etcdrwxr-xr-x. 2 root root 4096 Jun 28 2011 gamesdrwxr-xr-x. 2 root root 4096 Jun 28 2011 includedrwxr-xr-x. 2 root root 4096 Jun 28 2011 libdrwxr-xr-x. 2 root root 4096 Jun 28 2011 lib64drwxr-xr-x. 2 root root 4096 Jun 28 2011 libexec-rw-r--r--. 1 root root 2754 Nov 6 15:44 my.cnflrwxrwxrwx. 1 root root 34 Mar 8 15:34 mysql -> mysql-5.7.16-linux-glibc2.5-x86_64drwxr-xr-x. 12 mysql mysql 4096 Feb 27 18:33 mysql-5.6.34-linux-glibc2.5-x86_64drwxr-xr-x. 11 root mysql 4096 Nov 19 00:01 mysql-5.7.16-linux-glibc2.5-x86_64drwxr-xr-x. 7 7161 31415 4096 Feb 28 02:00 mysql-utilities-1.6.5-rw-r--r--. 1 root root 668241 Feb 28 01:59 mysql-utilities-1.6.5.tar.gzdrwxr-xr-x. 2 root root 4096 Jun 28 2011 sbindrwxr-xr-x. 5 root root 4096 Nov 6 22:15 sharedrwxr-xr-x. 2 root root 4096 Jun 28 2011 src
3、启动数据库并进入数据库
[root@host2 local]# /etc/init.d/mysqld startStarting MySQL.............................................[ OK ]..............................[root@host2 local]# mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.16-log MySQL Community Server (GPL)
(可以看到数据库已经到5.7版本了)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
4、更新数据结构(生产环境使用mysql_upgrade更新的时候加-s参数 不重建表)
[root@host2 local]# mysql_upgrade -p123 -smysql_upgrade: [Warning] Using a password on the command line interface can be insecure.The --upgrade-system-tables option was used, databases won't be touched.Checking if update is needed.Checking server version.Running queries to upgrade MySQL server.Upgrading the sys schema.Upgrade process completed successfully.Checking if update is needed.
至此升级成功
5、进入数据库查看
mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || sys || test |+--------------------+可以看到sys库已经存在,但是直接安装的5.7的库是没有test库的,这里sys和test同时存在说明是从5.6升级到5.7
看完上述内容,你们掌握mysql5.6怎么升级到mysql5.7的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注行业资讯频道,感谢各位的阅读!
数据
数据库
升级
内容
方法
更多
问题
更新
成功
束手无策
为此
原因
参数
同时
对此
技能
数据结构
时候
版本
环境
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
咖啡
互联网科技企业
广州大一互联网络科技有限公司
科技金融是不是互联网金融
麻工互联网科技
互联网金融 科技
互联网科技金融公司
世界互联网领先科技成果
睿民互联网科技
互联网科技美容
丰台科技园 互联网公司
创业天下互联网科技有限公司
速维有品互联网信息科技(苏州)有限公司
中国互联网十大科技股排名
烟台灵鸽互联网科技有限公司
21世纪互联网科技成就
国产互联网科技公司
互联网科技企业商标注意事项
数字科技和互联网金融哪个好
上海互联网科技园景观
中关村互联网科技集团
深圳天众互联网科技公司
互联网 视角下的科技创新
天速互联网络科技有限公司
中国的互联网科技企业的崛起
来此购互联网科技有限公司
互联网企业科技类企业如何做账
电子商务与互联网科技的关系
互联网科技包装股
艺电能源互联网科技有限公司招聘