win10同时安装mysql8.0

电脑上已经有mysql5.7,但是由于特殊要求需要再安装一个8.0版本

下载初始化和5.7一样。(注意my.ini配置)

1、安装服务

E:\mysql-8.0.30-winx64\bin>mysqld install mysql80
Install/Remove of the Service Denied!

解决:
要用管理员用户打开cmd

E:\mysql-8.0.30-winx64\bin>mysqld install mysql80
Service successfully installed.

2、启动mysql

net start mysql80

3、输入初始密码登录

E:\mysql-8.0.30-winx64\bin>mysql -u root -p
Enter password: ************
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.

解决:
在my.ini中添加

# 默认使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password

删除data目录,重新初始化mysql

4、全量导出数据库
登录mysql5.7导出:

mysqldump -u root -p --all-databases --lock-tables > E:\all.sql

登录mysql8.0导入:

source E:\all.sql

5、mysql8.0导入数据后,访问库报错

SQL 错误 [1045] [28000]: Access denied for user 'shopping'@'%' (using password: YES)
  Access denied for user 'shopping'@'%' (using password: YES)

查看日志:

2022-08-03T03:21:43.440745Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.user].
2022-08-03T03:21:43.441568Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.db].
2022-08-03T03:21:43.442352Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.tables_priv].
2022-08-03T03:21:43.443353Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.columns_priv].
2022-08-03T03:21:43.444344Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.procs_priv].
2022-08-03T03:21:43.445370Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.proxies_priv].
2022-08-03T03:21:43.446478Z 8 [Warning] [MY-013143] [Server] Column count of mysql.user is wrong. Expected 51, found 45. The table is probably corrupted
2022-08-03T03:21:43.447392Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.db. The table is probably corrupted!
2022-08-03T03:21:43.448069Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.tables_priv. The table is probably corrupted!
2022-08-03T03:21:43.448791Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.tables_priv. The table is probably corrupted!
2022-08-03T03:21:43.449533Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.columns_priv. The table is probably corrupted!
2022-08-03T03:21:43.450272Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.procs_priv. The table is probably corrupted!
2022-08-03T03:21:43.450991Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.procs_priv. The table is probably corrupted!
2022-08-03T03:21:43.451705Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.proxies_priv. The table is probably corrupted!
2022-08-03T03:21:43.452430Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.proxies_priv. The table is probably corrupted!
2022-08-03T03:21:43.453202Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.proxies_priv. The table is probably corrupted!

解决:
因为mysql5.7中系统表默认引擎为MyISAM
关闭服务,执行剩余升级任务:

mysqld --skip-grant-tables --user=mysql --upgrade=FORCE

参考资料:
https://blog.51cto.com/u_15463439/5226839
https://www.cnblogs.com/chengyunblogs/p/16112745.html
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值