码迷,mamicode.com
首页 > 数据库 > 详细

MySQL报'Access denied for user 'root'@'localhost' (using password: NO)'错误的解决

时间:2015-05-22 02:00:03      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:mariadb

当在命令提示符下执行该命令时,报下列错误

[root@clvn]# mysqladmin -u root password "sorry"
mysqladmin: connect to server at ‘localhost‘ failed
error: ‘Access denied for user ‘root‘@‘localhost‘ (using password: NO)‘

解决办法:

[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 Server

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

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

MariaDB [(none)]> set password for ‘root‘@‘localhost‘ =password(‘‘);
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

问题解决

 

本文出自 “云人生” 博客,请务必保留此出处http://ovcer.blog.51cto.com/1145188/1653660

MySQL报'Access denied for user 'root'@'localhost' (using password: NO)'错误的解决

标签:mariadb

原文地址:http://ovcer.blog.51cto.com/1145188/1653660

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!