MariaDB:登陆报错:mysqladmin: connect to server at 'localhost' failed

时间:2023-02-11 00:13:11

见图:

MariaDB:登陆报错:mysqladmin: connect to server at 'localhost' failed

解决办法:

  1. /etc/init.d/mysqld stop
  2. mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
  3. mysql -uroot –p
  4. mysql> UPDATE user SET Password=PASSWORD('新的密码') where USER='root' and hos t='root' or host='localhost';
  5. mysql> FLUSH PRIVILEGES;
  6. mysql> quit;
  7. /etc/init.d/mysqld start
  8. mysql -uroot –p  输入新的密码