首页 > 数据库技术 > 详细

ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: NO)

时间:2016-01-14 22:32:34      阅读:304      评论:0      收藏:0      [点我收藏+]

登陆mysql出现如下错误

[root@NeoKylin-CNVL/]# mysql

ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘(using password: NO)

 

解决办法:

[root@NeoKylin-CNVL/]# /etc/init.d/mysql stop

[root@NeoKylin-CNVL/]#mysqld_safe --user=mysql --skip-grant-tables--skip-networking &

[2] 8196

[root@NeoKylin-CNVL/]# 160114 19:30:36 mysqld_safe Logging to

‘/var/lib/mysql/NeoKylin-CNVL.cs1cloud.internal.err‘.

16011419:30:36 mysqld_safe A mysqld process already exists

 

mysql -u root mysql

Readingtable information for completion of table and column names

You canturn off this feature to get a quicker startup with -A

Welcometo the MySQL monitor.  Commands end with; or \g.

YourMySQL connection id is 2

Serverversion: 5.6.25 MySQL Community Server (GPL)

Copyright(c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracleis a registered trademark of Oracle Corporation and/or its

affiliates.Other names may be trademarks of their respective

owners.

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

 

mysql> UPDATE user SETPassword=PASSWORD(‘123‘) where USER=‘root‘;

QueryOK, 4 rows affected (0.00 sec)

Rowsmatched: 4  Changed: 4  Warnings: 0

 

mysql> FLUSH PRIVILEGES;

QueryOK, 0 rows affected (0.00 sec)

 

mysql> quit

重新启动mysql

[root@NeoKylin-CNVL/]# /etc/init.d/mysqld restart

[root@NeoKylin-CNVL/]#mysql -uroot -p

Enterpassword:

 

登陆成功

mysql>


本文出自 “DOSOM” 博客,谢绝转载!

ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: NO)

原文:http://8656934.blog.51cto.com/8646934/1735118

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!