• win10同时安装mysql8.0


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

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

    1、安装服务

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

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

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

    2、启动mysql

    net start mysql80

    3、输入初始密码登录

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

    解决:
    在my.ini中添加

    1. # 默认使用“mysql_native_password”插件认证
    2. 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导入数据后,访问库报错

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

    查看日志:

    1. 2022-08-03T03:21:43.440745Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.user].
    2. 2022-08-03T03:21:43.441568Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.db].
    3. 2022-08-03T03:21:43.442352Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.tables_priv].
    4. 2022-08-03T03:21:43.443353Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.columns_priv].
    5. 2022-08-03T03:21:43.444344Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.procs_priv].
    6. 2022-08-03T03:21:43.445370Z 8 [Warning] [MY-010929] [Server] Storage engine 'MyISAM' does not support system tables. [mysql.proxies_priv].
    7. 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
    8. 2022-08-03T03:21:43.447392Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.db. The table is probably corrupted!
    9. 2022-08-03T03:21:43.448069Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.tables_priv. The table is probably corrupted!
    10. 2022-08-03T03:21:43.448791Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.tables_priv. The table is probably corrupted!
    11. 2022-08-03T03:21:43.449533Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.columns_priv. The table is probably corrupted!
    12. 2022-08-03T03:21:43.450272Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.procs_priv. The table is probably corrupted!
    13. 2022-08-03T03:21:43.450991Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.procs_priv. The table is probably corrupted!
    14. 2022-08-03T03:21:43.451705Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.proxies_priv. The table is probably corrupted!
    15. 2022-08-03T03:21:43.452430Z 8 [Warning] [MY-013139] [Server] Cannot load from mysql.proxies_priv. The table is probably corrupted!
    16. 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
     

  • 相关阅读:
    基于.Net+SWEBUI开发的开源WMS仓库管理系统
    k8s教程:使用cert-manager证书管理工具在集群中提供https证书并自动续期
    SpringBoot雪花算法主键ID传到前端后精度丢失问题的解决
    【MHA】MySQL高可用MHA介绍5-所有参数
    【python百炼成魔】python之元组详解
    【奇葩问题】微信小程序 We分析 访问来源Top10的总比例为什么不止100%
    2022年09月 Python(四级)真题解析#中国电子学会#全国青少年软件编程等级考试
    猿创征文 | 组件的定义及复用性,局部组件和全局组件(2)
    力扣100题-07-三数之和
    Java集合-HashMap源码分析
  • 原文地址:https://blog.csdn.net/csj50/article/details/126135789