linux mysql access denied for user ‘root’@’localhost'(using password:YES)
2016-06-22 08:52
453 查看
linux安装完mysql后,使用程序连接报以上错误
解决方法,重新设置密码,步骤如下
1.先停掉原来的服务
2.使用安全模式登陆,跳过密码验证
3.登陆
4.修改密码
5.刷新权限
6.重新使用正常模式登陆
可以正常登陆。
7.执行其他命令:show databases; 提示如下错误
8.重新将密码设置一遍即可
9.配置完成。
解决方法,重新设置密码,步骤如下
1.先停掉原来的服务
service mysqld stop
2.使用安全模式登陆,跳过密码验证
mysqld_safe --user=mysql --skip-grant-tables --skip-networking&
3.登陆
mysql -uroot mysql
4.修改密码
mysql > update user set authentication_string = password('123456') where user = 'root' and Host = 'localhost'
5.刷新权限
mysql > flush privileges;
6.重新使用正常模式登陆
#mysql -uroot -p #enter password : 123456
可以正常登陆。
7.执行其他命令:show databases; 提示如下错误
You must reset your password using ALTER USER statement before executing this statement.
8.重新将密码设置一遍即可
mysql > set password = password ('123456');
9.配置完成。
相关文章推荐
- CentOS 7 and RHEL 7 安装FreeSWITCH 1.6
- Linux下批量Kill多个进程的方法
- 【Linux】linux常用基本命令
- 每天一个Linux命令(55)systemctl命令
- linux系统安装rsync和sersync实现数据实时同步详细步骤(rsync实时同步)
- linux数据拷贝复制到移动硬盘的问题
- CentOS 6.5下JIRA安装部署
- linux中fcntl()、lockf、flock的区别
- linux下执行mysql的sql文件
- mysql 5.7.13 安装配置方法图文教程(linux)
- Linux环境mysql5.7.12安装教程
- CentOS 7安装配置Samba
- (总结)Linux的chattr与lsattr命令详解
- linux任务后台执行方法
- 64位CentOS系统中安装32位开发库
- 小凡的Linux主机与时间服务器同步记录
- linux常用基本命令总结
- linux tar 命令
- stat函数讲解(转)
- Linux下调试工具gdb的使用方法