mysql - 错误 1045 (28000) : Access denied for user 'root' @'localhost' (using password: YES) on Ubuntu (Zorin OS)

标签 mysql linux ubuntu

我已经尝试了很多来摆脱这种情况。但是我该如何解决呢?

sudo mysql_secure_installation
输出:
Securing the MySQL server deployment.

Enter password for user root: 
Error: Access denied for user 'root'@'localhost' (using password: YES)
sudo mysql -u root -p
同样的结果。无法重设密码。
尝试进入mysql时出现此错误:
sudo mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
我该如何解决这个问题?

最佳答案

尝试
grep '为 root@localhost 生成一个临时密码'/var/log/mysqld.log |tail -1
和测试密码

关于mysql - 错误 1045 (28000) : Access denied for user 'root' @'localhost' (using password: YES) on Ubuntu (Zorin OS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70869214/

相关文章:

PHP->sql UPDATE 行,其中来自其他 2 行的数据在同一个表中合并在一起

mysql - ActiveRecord多关联查询

MYSQL 线程限制

linux - 在 Ansible 中使用查找和复制模块

linux - 检查字符串长度 - Linux

MySQL boolean 模式匹配不返回任何内容

linux - keras 和 tensorflow 没有在 centos 7 的 gpu 上运行

python - pip install 编译成功后执行导入错误

apache - 为什么只有当我进入容器的 bash 时才能访问我的 Apache 默认页面?

ubuntu - 如何使用 Chef 在 crontab 中设置环境变量?