mysql 5.6提高了安全性,默认安装完之后,不允许空密码登录,而是在/root/.mysql_secret,记录了密码,所以首次登录,必须用这个文件里面的密码登录
[root@nagios ~]# cat .mysql_secret
# The random password set for the root user at Mon Oct 28 17:24:41 2013 (local time): Zirbdc2P
[root@nagios ~]# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.13
mysql> use mysql;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> set password=password(‘123456’);
Query OK, 0 rows affected (0.10 sec)
必须强制你修改密码,否则不让操作,必须用set password命令修改,修改后
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
转载于:https://blog.51cto.com/gtianf/1316384
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/109984.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...