安装mysql 5.7.11,初始登录出现:mysql Access denied for user 'root'@'localhost' (using password: YES)
2016-03-29 22:54
585 查看
纸上学来终觉,绝知此事要躬行
今天在mac上安装mysql 5.7.11,安装快完成的时候,出现弹窗提示:
2016-03-29T13:06:20.543782Z 1 [Note] A temporary password is generated for root@localhost: .XzVm9bi>EGy
If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.
写得很明白:用户名:root,临时的密码:.XzVm9bi>EGy
当时仔细地把这句话给保存下来了,觉得后面的路应该顺风顺水了。
然而,当输入密码的时候:
mysql -uroot -p".XzVm9bi>EGy"
出现错误:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
试过好几次,硬是不对。
然后想,竟然密码不对,那就重新改吧。
结果一找,全部是:mysqld_safe --skip-grant-tables
但是问题是,5.7.11这版本的mysqld_safe根本没有--skip-grant-tables这个参数。
(此处存疑问,如有知道5.7.11如何取回密码的麻烦告知一下,这里的问题并不是这个)
弄了好久,发现正确的方式应该是:
mysql -uroot -p
然后在提示的Enter password:中输入密码即可
今天在mac上安装mysql 5.7.11,安装快完成的时候,出现弹窗提示:
2016-03-29T13:06:20.543782Z 1 [Note] A temporary password is generated for root@localhost: .XzVm9bi>EGy
If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.
写得很明白:用户名:root,临时的密码:.XzVm9bi>EGy
当时仔细地把这句话给保存下来了,觉得后面的路应该顺风顺水了。
然而,当输入密码的时候:
mysql -uroot -p".XzVm9bi>EGy"
出现错误:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
试过好几次,硬是不对。
然后想,竟然密码不对,那就重新改吧。
结果一找,全部是:mysqld_safe --skip-grant-tables
但是问题是,5.7.11这版本的mysqld_safe根本没有--skip-grant-tables这个参数。
(此处存疑问,如有知道5.7.11如何取回密码的麻烦告知一下,这里的问题并不是这个)
弄了好久,发现正确的方式应该是:
mysql -uroot -p
然后在提示的Enter password:中输入密码即可
相关文章推荐
- mysql别名
- mysql绿色版安装使用配置教程?
- mysql字符集
- 【MySQL】结构行长度的一些限制
- mysql存储过程入门
- 忘记mysql密码解决方法
- 实战:sqlserver 数据实时同步到mysql
- mysql事务之可重复读(Repeated Read)
- mysql事务之提交读(Read Committed)
- 优化mysql数据库性能的十个参数
- mysql事务之未提交读(Read uncommitted)
- 解压安装5.7以上版本的MySQL
- MySQL同时执行多条查询
- mysql数据库sql优化原则
- 详解mysql int类型的长度值问题
- mysql导入/导出CSV文件
- mysql 编码问题
- 添加mysql.h头文件
- MySql存储引擎
- mysql查询练习