MySQL从老版本5.7切换到新版本8.0 操作步骤,数据库备份,新库运行脚本
起首备份MySQL5.7中所必要的库通过navicat或者其它远程毗连工具转储成SQL文件(布局和数据)
使用安装程序Installer卸载
安装程序不仅用来安装MySQL(可安装多个不同版本的MySQL服务),还可以用来修复及卸载MySQL。使用它卸载的好处就是能卸载干净,卸载不干净再重装很大概会出题目!
https://img-blog.csdnimg.cn/direct/63925700ac70493b889bfdf1a769309a.png
https://img-blog.csdnimg.cn/direct/9d98ee26d21e40b78cd66b20efb78430.png
https://img-blog.csdnimg.cn/direct/005aa2ad3e334eba957fcd704a20a2d1.png
https://img-blog.csdnimg.cn/direct/bdb263f042e24603bdbfa341b1877b20.png
https://img-blog.csdnimg.cn/direct/259b3ec3e2d14f5aac5e4d3808a7e71b.png
https://img-blog.csdnimg.cn/direct/2e19bf464ab1434b9384d12d92c8b22a.png
https://img-blog.csdnimg.cn/direct/29811c2b1b4f4b0794fa749f79ce62fe.png
卸载完成
安装MySQL 8.0.36
双击打开下载好的 MySQL安装包 mysql-installer-community-8.0.36.0.msi
https://img-blog.csdnimg.cn/direct/7acca22e122f49a3bcdb504dc739a8af.png
https://img-blog.csdnimg.cn/direct/f38b4dcfc1624f3bba2dfb639f225732.png
https://img-blog.csdnimg.cn/direct/b4c1731ce3724dacabc2ab23d50b9fb2.png
https://img-blog.csdnimg.cn/direct/ea65e2ba88e44c4ebbf8f35696d2a886.png
https://img-blog.csdnimg.cn/direct/28acd883481445319cf53bce490fad73.png
https://img-blog.csdnimg.cn/direct/406cada2e84e4f63b42df7f3dfd3fce9.png
https://img-blog.csdnimg.cn/direct/86eec3c2f1b44eacb88838e09f036598.png
https://img-blog.csdnimg.cn/direct/11c4b5478c624ae09b173a5abf2135a3.png
一步要注意,最好选择传统暗码验证方式,否则使用第三方数据库管理软件在毗连时会报错。
https://img-blog.csdnimg.cn/direct/44d3c725d04644218fc4a389cf2581e2.png
https://img-blog.csdnimg.cn/direct/de3f986c3803446299809779915dbd0c.png
https://img-blog.csdnimg.cn/direct/ec4f9148d2334b10b412a7b740e091e7.png
https://img-blog.csdnimg.cn/direct/2e3c16043a934559a8ee2d89f3965bb2.png
https://img-blog.csdnimg.cn/direct/d5e0a58bd5ab4e7894d4ae46745e7596.png
https://img-blog.csdnimg.cn/direct/85b07a4ad4ee48b88789e6e73d61d5c0.png
安装完成
https://img-blog.csdnimg.cn/direct/f86b5201ec0f4857a6b5b8a12535939c.png
https://img-blog.csdnimg.cn/direct/1d83afc674434a8a97099cf1e1ac4953.png
使用远程毗连工具毗连MySQL
https://img-blog.csdnimg.cn/direct/3e941e01beb94a13b98b27b87ed30859.png
此时毗连测试会出现以下提示,该主机不答应毗连到MySQL服务,必要修改访问权限
https://img-blog.csdnimg.cn/direct/fc01ffa4ab2743f484f5baeb81b29076.png
进入MySQL下令操作页面
https://img-blog.csdnimg.cn/direct/0d7b4776957a42cbbfa06d9392823386.png
https://img-blog.csdnimg.cn/direct/36a283dbb17c4f1fad2462f59ad4d2d2.png
https://img-blog.csdnimg.cn/direct/04b70b2de2bf4aa5a58c8b664040b473.png
下令:
use mysql; --使用mysql这个库
show tables; --查询所有表
select host,user from user; --查询user表中host、user
update user set Host=‘%’ where User=‘root’; --更新user为root账号的host,默认是本地
flush privileges; --革新权限
https://img-blog.csdnimg.cn/direct/45756e16edc549ffa29700a575c72cb1.png
https://img-blog.csdnimg.cn/direct/62317d2d37e2456a8e7225787def5005.png
革新权限后(flush privileges),Navicat mysql 可以连上了。
https://img-blog.csdnimg.cn/direct/a092caba39334f70b85a8efc9651aefe.png
新建数据库
https://img-blog.csdnimg.cn/direct/711191563a6f400c9588d4b7a1552adf.png
https://img-blog.csdnimg.cn/direct/01ba91a059c848bd902c6cca392d1ff3.png
将之前转储的SQL文件,导入到新库中执行
https://img-blog.csdnimg.cn/direct/a7a6124e0c3144279da8a2312a27f794.png
执行成功
https://img-blog.csdnimg.cn/direct/4644717d4f9140538b0438d10f465bf6.png
数据库更新完毕
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]