linux登录MySQL,报错ERROR 1045 (28000)解决办法
2016-11-29 13:14
477 查看
CentOS
命令登录
MySQL
时,报错
ERROR 1045 (28000): Access denied for user root@localhost
(using password: NO)
错误解决方法
1
、停用
mysql
服务:
# /etc/rc.d/init.d/mysqld stop
2
、输入命令:
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3
、登入数据库:
# mysql -u root mysql
4
、
mysql> use mysql;
结果如下:
Database changed
5
、
mysql> UPDATE user SET Password=PASSWORD('newpassword')where USER='newuser';
结果如下:
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3
Changed: 3
Warnings: 0
mysql>FLUSH PRIVILEGES;
结果如下:
Query OK, 0 rows affected (0.00 sec)
mysql> quit
# /etc/init.d/mysql restart
# mysql -u newuser
–
p
Enter password:newpassword
mysql><
登录成功
命令登录
MySQL
时,报错
ERROR 1045 (28000): Access denied for user root@localhost
(using password: NO)
错误解决方法
1
、停用
mysql
服务:
# /etc/rc.d/init.d/mysqld stop
2
、输入命令:
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3
、登入数据库:
# mysql -u root mysql
4
、
mysql> use mysql;
结果如下:
Database changed
5
、
mysql> UPDATE user SET Password=PASSWORD('newpassword')where USER='newuser';
结果如下:
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3
Changed: 3
Warnings: 0
mysql>FLUSH PRIVILEGES;
结果如下:
Query OK, 0 rows affected (0.00 sec)
mysql> quit
# /etc/init.d/mysql restart
# mysql -u newuser
–
p
Enter password:newpassword
mysql><
登录成功
相关文章推荐
- CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解决方法
- mysql登录时,ERROR 1045 (28000): 错误解决办法
- 20161218Linux mysql ERROR 1045(28000):解决办法Denied
- Mysql登录时报错 ERROR 1045 (28000): 错误解决办法
- mysql登录时,ERROR 1045 (28000): 错误解决办法
- mysql登录时,ERROR 1045 (28000): 错误解决办法
- 解决Linux下MySQL登录ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor)问题
- 解决MySQL登录ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)问题
- MySQL无法登录问题-"ERROR 1045 (28000): Access denied for user 'root'@'localhost'"-之解决方法-密码重置
- CentOS 7.4下解决登录MySQL时,ERROR 1045 (28000): Access denied for user root@localhost (using password: YES
- CentOS命令登录MySQL时,报错ERROR 1045 (28000):
- mysql忘记密码以及出现error 1045(28000)时的解决办法
- MySQL登录时报ERROR 1045 (28000): Access denied for user 的解决方法
- CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解
- CentOS命令登录MySQL时,报错ERROR 1045 (28000)
- mysql登录报错ERROR 1045 (28000的解决方法
- mysql登录报错ERROR 1045 (28000的解决方法
- mysql登录报错ERROR 1045 (28000) 的解决方法
- MySQL5.5出面ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题的解决办法
- mysql报错:ERROR 1045 (28000): Access 解决办法