Ubuntu Mysql修改密码时遇到的问题 正确的完整流程如下:

参考:

ubuntu18.04 首次登录mysql未设置密码或忘记密码解决方法_ubuntu中mysql设置密码-CSDN博客

1. use mysql; #连接到mysql数据库
2. update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost'; #修改密码123456是密码
3. update user set plugin='mysql_native_password';
4. flush privileges;
5. quit;

执行到2步报错:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(‘123456’) where user=‘root’ and Host =‘localhost’' at line 1
替换为:

mysql> SET PASSWORD = '123456';

又报错:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

解决:

ERROR 1819 (HY000) Your password does not satisfy the current policy requirements-阿里云开发者社区 (aliyun.com)

正确的完整流程如下:

上述步骤执行成功后,执行

service mysql start # 启动
sudo mysql -u root -p # 登录

报错: ERROR 1045 (28000): Access denied for user ‘debian-sys-maint‘@‘localhost‘ 

参考:【问题解决记录】Ubuntu mysql修改密码错误 ERROR 1045 (28000): Access denied for user ‘debian-sys-maint‘@‘localhost‘_error 1045 (28000): access denied for user 'debian-CSDN博客

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-30 15:22:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-30 15:22:03       101 阅读
  3. 在Django里面运行非项目文件

    2024-04-30 15:22:03       82 阅读
  4. Python语言-面向对象

    2024-04-30 15:22:03       91 阅读

热门阅读

  1. 【软测学习笔记】Linux入门Day01

    2024-04-30 15:22:03       28 阅读
  2. 点云和去噪

    2024-04-30 15:22:03       38 阅读
  3. K8S集群安装

    2024-04-30 15:22:03       28 阅读
  4. Android APP转成launcher

    2024-04-30 15:22:03       35 阅读
  5. Linux第六章

    2024-04-30 15:22:03       35 阅读
  6. 内存溢出如何实现自动化重启

    2024-04-30 15:22:03       36 阅读
  7. docker

    docker

    2024-04-30 15:22:03      35 阅读
  8. Ubuntu/Linux Anaconda 命令行终端安装

    2024-04-30 15:22:03       37 阅读