本文摘自PHP中文网,作者angryTom,侵删。

navicat在连接MySQL8.0及以上版本的时候,总是报错1251;原因是MySQL8.0版本的加密方式和MySQL5.0的不一样,连接会报错。下面就为大家介绍一下详细的解决办法。
推荐教程:MySQL数据库入门视频教程
1、先通过命令行进入mysql的root账户:
1 | PS C:\Windows\system32> mysql -uroot -p
|
再输入root的密码:
1 2 3 4 5 6 7 8 9 10 | Enter password : ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 8.0.11 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>
|
2、更改加密方式:
1 2 | mysql> ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.10 sec)
|
3、更改密码:该例子中 123为新密码
阅读剩余部分
相关阅读 >>
Navicat怎么查看关系图
Navicat如何批量导入excel表格数据
Navicat怎么添加字段
Navicat怎么设置主键自增
怎么将sql文件导入Navicat
Navicat怎样创建数据库
Navicat premium如何导出表结构
Navicat怎么修改数据
Navicat12怎么使用
Navicat for mysql下载安装以及简单的使用
更多相关阅读请进入《Navicat》频道 >>
机械工业出版社
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。
转载请注明出处:木庄网络博客 » navicat错误1251