Mysql登录出错userroot@localhost(usingpassword:NO)

环境:redhat 5.7 安装了MySQL 5.0
安装完mysql之后启动成功,但是使用mysql -uroot -p登录是,密码错误,确定没有设置过密码
出错提示:Access denied for user 'root'@'localhost' (using password : No)
解决办法如下:

10年积累的成都网站建设、成都网站制作经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站制作后付款的网站建设流程,更有霞浦免费网站建设让你可以放心的选择与我们合作。

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:

更多资源请访问www.arppinging.com


当前名称:Mysql登录出错userroot@localhost(usingpassword:NO)
浏览地址:http://scjbc.cn/article/ppsjhi.html

其他资讯