环境:redhat 5.7 安装了Mysql 5.0安装完mysql之后启动成功,但是使用mysql -uroot -p登录是,密码错误,确定没有设置过密码出错提示:Access denied for us
环境:redhat 5.7 安装了Mysql 5.0
安装完mysql之后启动成功,但是使用mysql -uroot -p登录是,密码错误,确定没有设置过密码
出错提示:Access denied for user 'root'@'localhost' (using passWord : No)
解决办法如下:
1.先关闭mysql服务
xiaopeng# /etc/init.d/mysqld stop
2.输入操作命令
xiaopeng# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3.连接mysql
xiaopeng# mysql -uroot mysql
mysql> update user set Password=PASSWORD('newpassword') where USER='root';
mysql> flush PRIVILEGES;
mysql> quit
4.重启mysql服务
xiaopeng# /etc/init.d/mysqld restart
xiaopeng# mysql -uroot -p
Enter password:<newpassword>
更多资源请访问www.arppinging.com
--结束END--
本文标题: Mysql登录出错 user root@localhost(using password:NO)
本文链接: https://www.lsjlt.com/news/36789.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0