最近研究一下MySQL 5.6 版本发现安装后,使用空密码无法登陆
安装的过程中有这样的一句话:
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.
大概意思就是 一个随机的密码已经生成 可以在 '/root/.mysql_secret'. 中找到
第一次连接必须变更密码 且只能使用 'SET PASSWORD' 命令
在user 表中新增加了'password expired' 列,也就是密码过期
我们来启动mysql 然后登陆
service mysql start
mysql -uroot -pvssAWF0O
#密码是在 more .mysql_secret 里面记录
# The random password set for the root user at Mon Mar 25 11:13:11 2013 (local time): vssAWF0O
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.