SQLyog连接MySQL8.0报2058错误的完美解决方法

原因其实很简单,就是在mysql8.0增加了安全认证,所以在连接的过程出现了2058 code

1.使用mysql数据库

2.修改mysql 中的user表

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

将password改成自己需要的密码

3.执行流程如下

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MySQL\MySQL Server 8.0>"MySQL 8.0 Command Line Client - Unicode.lnk"
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, 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.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Database changed
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Query OK, 0 rows affected (0.06 sec)

完美解决
SQLyog连接MySQL8.0报2058错误的完美解决方法_第1张图片

你可能感兴趣的:(mysql,数据库)