mysql 报错: The specified database user/password combination is rejected: [28000][1045]

报错:

The specified database user/password combination is rejected: [28000][1045] Could not connect to address=(host=localhost)(port=3306)(type=master) : (conn=18) Access denied for user 'root'@'127.0.0.1' (using password: YES) Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding' [28000][1045] (conn=18) Access denied for user 'root'@'127.0.0.1' (using password: YES) Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'

参考: https://blog.csdn.net/weixin_39608791/article/details/108323651 没找到答案
https://blog.csdn.net/qq_28938933/article/details/72872064

我的数据库是在docker中部署的 ipburger/mysql-alpine.docker:release (MariaDB)

1, my.ini中
 在[mysqld]下添加skip-grant-tables,保存即可。
2, 重启docker 容器
3, 进入容器内部
mysql -u root -p;
  回车
  use mysql;

4, select host,user,password from user order by host desc,user desc;
将排序序列中最前面的用户修改host为’%’
5 改不了 就把最前面的用户删掉
DELETE FROM mysql.user where host = ‘127.0.0.1’ and user = ‘root’;
flush privileges;
好了 数据库就可以连上了

他奶奶个腿!
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值