當在命令提示符下執行該命令時,報下列錯誤mysql
[root@clvn]# mysqladmin -u root password "sorry"
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'sql
解決辦法:ide
[root@clvn]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 110
Server version: 5.5.31-MariaDB-log MariaDB Serverspa
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.server
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.input
MariaDB [(none)]> set password for 'root'@'localhost' =password('');
Query OK, 0 rows affected (0.00 sec)it
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)io
問題解決class