赞
踩
连接数据库或者在Navicat连接数据库,报错信息为:1045 - Access denied for user 'root'@'localhost' (using password:YES)
连接数据库报错问题
- # 终端连接报错提示信息
- 1045 - Access denied for user 'root'@'localhost' (using password:YES)
C:\Program Files\MySQL\MySQL Server 5.5\bin
cmd
- # window环境 停止mysql服务命令
- net stop mysql
-
- # 虚拟机centos环境 停止mysql服务命令
- service mysqld stop
- # window环境 停止mysql服务命令
- mysqld --skip-grant-table
-
- # 虚拟机centos环境 停止mysql服务命令
- mysqld_safe --skip-grant-table
mysql -u root mysql
- # 重置root用户密码为:test132456
- UPDATE user SET Password=PASSWORD(‘test123456’) where USER=‘root’;
重置密码成功
- # 更新命令
- FLUSH PRIVILEGES;
-
- # 删除空user命名
- delete from user where USER='';
- # 连接数据库
- mysql -u root -p
-
- # 输输入重置的密码test123456
- test123456
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。