《MysqL学习在linux安装MysqL重启提示You must SET PASSWORD before executing this statement的解决方法》要点:
本文介绍了MysqL学习在linux安装MysqL重启提示You must SET PASSWORD before executing this statement的解决方法,希望对您有用。如果有疑问,可以联系我们。
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
非常诡异啊,明明用密码登陆进去了,怎么还提示需要密码.
参考官方的一个文档,见http://dev.MysqL.com/doc/refman/5.6/en/alter-user.HTML.如下 *** 作后就ok了:
MysqL> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
MysqL> SET PASSWORD = PASSWORD('123456');
query OK,0 rows affected (0.00 sec)
MysqL> show databases;
5 rows in set (0.00 sec)
也就是用MysqL> SET PASSWORD = PASSWORD('123456');这句话重新设置一次密码!哎,搞得真费劲啊.
有的童鞋也会遇到如下问题:
最近新装好的MysqL在进入MysqL工具时,总是有错误提示:
# MysqL -u root -p
Enter password:
ERROR 1045 (28000): Access denIEd for user 'root'@'localhost' (using password: NO)
或者
# MysqL -u root -p password 'newpassword'
Enter password:
MysqLadmin: connect to server at 'localhost' Failed
error: 'Access denIEd for user 'root'@'localhost' (using password: YES)'
现在终于找到解决方法了.本来准备重装的,现在不必了.
方法 *** 作很简单,如下:
# /etc/init.d/MysqL stop
# MysqLd_safe --user=MysqL --skip-grant-tables --skip-networking &
# MysqL -u root MysqL
MysqL> UPDATE user SET Password=PASSWORD('newpassword') where USER='root' and host='root' or host='localhost';//把空的用户密码都修改成非空的密码就行了.
MysqL> FLUSH PRIVILEGES;
MysqL> quit # /etc/init.d/MysqLd restart
# MysqL -uroot -p
Enter password: <输入新设的密码newpassword>
MysqL5.6 *** 作时报错:You must SET PASSWORD before executing this statement解决
MysqL> SET PASSWORD = PASSWORD('123456');
query OK,0 rows affected (0.03 sec)
MysqL> create database roger;
query OK,1 row affected (0.00 sec)
也就是用MysqL> SET PASSWORD = PASSWORD('123456');这句话重新设置一次密码!就搞定了. 总结
以上是内存溢出为你收集整理的Mysql学习在linux安装mysql重启提示You must SET PASSWORD before executing this statement的解决方法全部内容,希望文章能够帮你解决Mysql学习在linux安装mysql重启提示You must SET PASSWORD before executing this statement的解决方法所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)