mysql登陆ERROR 1045 (28000): Access denied for user

Enter current password for root (enter for none): 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

报错信息显示useing passowrd:YES 说明密码是对的,但是拒绝用户root登陆
找到MysqL配置文件进行修改

mysql登陆ERROR 1045 (28000): Access denied for user

添加skip-grant-tables表示跳过密码验证登陆
然后重启MysqL服务

systemctl restart mariadb.service

然后跳过密码登陆MysqL

MysqL -uroot -p
Enter password: 不用输入密码

然后进入MysqL数据库进行修改root密码:

MariaDB [(none)]> use MysqL;
MariaDB [MysqL]> update user set password=password("000000") where user="root";
MariaDB [MysqL]> flush privileges; //刷新权限表
MariaDB [MysqL]> quit

修改my.conf配置文件把刚才配置的skip-grant-tables去掉
然后重启MysqL服务验证密码登陆:

systemctl restart mariadb.service
MysqL -uroot -p000000
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 10.1.17-MariaDB MariaDB Server

copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

OK,成功登陆进来。

相关文章

安装开始...1.打开“https://dev.mysql.com/downloadsepo/yu...
安装Helm3#官网下载慢#wgethttps://get.helm.sh/helm-v3.5.4...
通过Linux命令行启动用的指令:systemctlstartmariadb.servi...
InstallingMariaDBServer10.4TodeployMariaDBCommunityServe...
阅读目录一什么是存储引擎二mysql支持的存储引擎三使用存储引...
1、安装MariaDB安装命令yum-yinstallmariadbmariadb-server安...