出现1251错误代码

是因为mysql8.0的密码加密方式与之前5.0的不同

如果是字母式的密码 比如root 可能会出现这种情况

1.先通过命令行进入mysql的root账户

 Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. MySQL Community Server - GPL Copyright (c) , , 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.

2.更改加密方式

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.08 sec)

 

3.更改密码

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
Query OK, 0 rows affected (0.02 sec)

 

4.刷新

 mysql> FLUSH PRIVILEGES;
Query OK, rows affected (0.01 sec)

5.完成

 

最新文章

  1. jsonp模拟获取百度搜索相关词汇
  2. Install and set JAVA home on MAC OS with commandline
  3. c++怎么将一个类,拆分出接口类,和实现类
  4. linux系统执行多条命令,linux系统执行复合命令
  5. python学习之列表
  6. GPGPU OpenCL/CUDA 高性能编程的10大注意事项
  7. asp.net WebForm 多语言的实现
  8. tomcat+redis实现session共享缓存
  9. 使用SpringSecurity3用户验证(异常信息,验证码)
  10. Mac实用操作技巧(一)
  11. Openstack_O版(otaka)部署_Horizon部署
  12. palindrome number(回文数)
  13. mysql学习之check无效的解决及触发器的使用
  14. phthon--------异常处理
  15. Openresty 进行路由系统设计
  16. Flask 构建微电影视频网站(一)
  17. Python 调用图像融合API
  18. nodejs -- require , exports , module
  19. hdu 1392 Surround the Trees 凸包裸题
  20. C点滴成海------Dev C++怎么修改成简体中文

热门文章

  1. inconsistent use of tabs and spaces in indentation
  2. windows 10安装linux(ubuntu)子系统
  3. txt文件太大打不开怎么办
  4. 2、基本方法(Basic Recipes)
  5. dp(完全背包)
  6. 【CSS属性#1】
  7. 中山纪中Day1--普及
  8. Java面向对象简单知识总结-考试用
  9. 基于soa的架构
  10. juypter