ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: NO)
2016-01-14 20:02
519 查看
登陆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>
[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>
相关文章推荐
- 访问Nginx发生SSL connection error的一种情况
- 星外虚拟主机访问被控出现Unspecified error解决方法
- IIS 错误 Server Application Error 详细解决方法
- On Error Resume Next 语句
- IIS运行错误 Server Application Error 错误代码 Error: 8004的解决方法
- Lua编程示例(一):select、debug、可变参数、table操作、error
- 收集整理的http/1.1 500 server error错误的解决方法
- SQL 2005 ERROR:3145 解决办法(备份集中的数据库备份与现有的数据库不同)
- VBScript中On Error语句用法小结
- 解决VC++编译报错error C2248的方案
- jQuery Uploadify 上传插件出现Http Error 302 错误的解决办法
- JQuery ajax中error返回错误及一直返回error的解答
- PHP函数之error_reporting(E_ALL ^ E_NOTICE)详细说明
- node.js使用npm 安装插件时提示install Error: ENOENT报错的解决方法
- PHP 5.3和PHP 5.4出现FastCGI Error解决方法
- 解决mysql ERROR 1017:Can't find file: '/xxx.frm' 错误
- MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)问题的解决
- vs2012 error c4996: This function or variable may be unsafe
- php异常:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE eval()'d code error
- ERROR/AndroidRuntime(17121)的问题解决