当前位置:论坛首页 > Linux面板 > 求助

【已解决】数据库管理密码错误

发表在 Linux面板2022-7-9 21:19 [复制链接] 11 7944

新建数据库,和备份,都一直提示:数据库管理密码错误,这个怎么处理呢?
使用道具 举报 只看该作者 回复
发表于 2022-7-9 22:35:23 | 显示全部楼层
1043829116 发表于 2022-7-9 22:05
重置了,服务器也重启了,还是不行。 照样:数据库管理密码错误!
怎么搞呢? ...

如果phpmyadmin也登录不了的话,试试这个方法
  1. mysql的root@localhost账户丢失,恢复步骤
  2. mysql> use mysql;
  3. Database changed

  4. mysql> insert into user set user='root',ssl_cipher='',x509_issuer='',x509_subject='';
  5. Query OK, 1 row affected (0.00 sec)

  6. mysql> flush privileges;
  7. Query OK, 0 rows affected (0.00 sec)

  8. mysql> grant all privileges on *.* to 'root'@'localhost' identified by 'passwd' with grant option;
  9. Query OK, 0 rows affected (0.00 sec)

  10. mysql> flush privileges;
  11. Query OK, 0 rows affected (0.00 sec)

  12. passwd是初始的密码
复制代码
使用道具 举报 回复 支持 1 反对 0
发表于 2022-7-9 21:24:41 | 显示全部楼层
数据库页面--重置一下mysql的root密码就可以了
使用道具 举报 回复 支持 反对
发表于 2022-7-9 22:05:49 | 显示全部楼层
堡塔安全木兰 发表于 2022-7-9 21:24
数据库页面--重置一下mysql的root密码就可以了

重置了,服务器也重启了,还是不行。 照样:数据库管理密码错误!
怎么搞呢?
使用道具 举报 回复 支持 反对
发表于 2022-7-9 23:03:46 | 显示全部楼层
堡塔安全木兰 发表于 2022-7-9 22:35
如果phpmyadmin也登录不了的话,试试这个方法

按你这方法弄了,还是不行呀。接下来怎么整?
使用道具 举报 回复 支持 反对
发表于 2022-7-9 23:05:24 | 显示全部楼层
1043829116 发表于 2022-7-9 23:03
按你这方法弄了,还是不行呀。接下来怎么整?

将命令执行结果截图上传附件给我看看
使用道具 举报 回复 支持 反对
发表于 2022-7-9 23:33:06 | 显示全部楼层
堡塔安全木兰 发表于 2022-7-9 23:05
将命令执行结果截图上传附件给我看看

[root@VM-0-5-centos ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 58
Server version: 5.6.50-log Source distribution

Copyright (c) 2000, 2020, 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;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
mysql> insert into user set user='root',ssl_cipher='',x509_issuer='',x509_subject='';
ERROR 1046 (3D000): No database selected
mysql> flush privileges;
ERROR 1227 (42000): Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
mysql> grant all privileges on *.* to 'root'@'localhost' identified by 'F65pMaahFrWMwGr4' with grant option;
ERROR 1045 (28000): Access denied for user ''@'localhost' (using password: NO)
mysql> flush privileges;
ERROR 1227 (42000): Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
mysql>
使用道具 举报 回复 支持 反对
发表于 2022-7-10 00:04:06 | 显示全部楼层
1043829116 发表于 2022-7-9 23:33
[root@VM-0-5-centos ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL ...
  1. mysql的root@localhost账户丢失,恢复步骤
  2. 注意:需要使用127.0.0.1登录
  3. mysql -h 127.0.0.1 -u root -p

  4. mysql> use mysql;
  5. Database changed

  6. mysql> insert into user set user='root',ssl_cipher='',x509_issuer='',x509_subject='';
  7. Query OK, 1 row affected (0.00 sec)

  8. mysql> flush privileges;
  9. Query OK, 0 rows affected (0.00 sec)

  10. mysql> grant all privileges on *.* to 'root'@'localhost' identified by 'passwd' with grant option;
  11. Query OK, 0 rows affected (0.00 sec)

  12. mysql> flush privileges;
  13. Query OK, 0 rows affected (0.00 sec)

  14. passwd是初始的密码
复制代码
使用道具 举报 回复 支持 反对
发表于 2022-7-10 00:27:32 | 显示全部楼层

按你此方法已经处理好,谢谢!辛苦了。
使用道具 举报 回复 支持 反对
发表于 2022-7-10 00:28:45 | 显示全部楼层

按你这方法,已经处理好,谢谢了。
使用道具 举报 回复 支持 反对
发表于 2022-7-15 13:28:32 | 显示全部楼层
1043829116 发表于 2022-7-10 00:28
按你这方法,已经处理好,谢谢了。

你好 我按照你的方法添加数据库成功了,但是导入备份的数据库时 还出现 数据库管理密码错误是什么情况?
使用道具 举报 回复 支持 反对
发表于 2022-12-3 15:03:55 | 显示全部楼层
同样的问题,方法有效,已经处理好,谢谢了。宝塔的工作人员辛苦了
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理
快速回复 返回顶部 返回列表