第一次打开mysqlshi报错“Accerss denied for user 'root'@local
2016-04-03 17:39
501 查看
可以依次执行下面几步:
1.Start the MySQL server instance or daemon with the –skip-grant-tables option (security setting).
2.Execute these statements.
3.Finally, restart the instance/daemon without the –skip-grant-tables option.
然后就可以了 stackoverflow的链接:http://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost
如果上面还不行可能是没关闭mysql服务:
1. mysqld –skip-grant-tables
2. mysql -u root
3. use mysql;
4. update user set password=PASSWORD(“NEW-ROOT-PASSWORD”) where User=’root’;
5. flush privileges;
6. quit
然后,关闭mysql 服务
5.7 mysql的密码字段改名了
1.Start the MySQL server instance or daemon with the –skip-grant-tables option (security setting).
$ mysqld --skip-grant-tables
2.Execute these statements.
$ mysql -u root mysql
$mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root';
$mysql> FLUSH PRIVILEGES;
3.Finally, restart the instance/daemon without the –skip-grant-tables option.
$ /etc/init.d/mysql restart
然后就可以了 stackoverflow的链接:http://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost
如果上面还不行可能是没关闭mysql服务:
1. mysqld –skip-grant-tables
2. mysql -u root
3. use mysql;
4. update user set password=PASSWORD(“NEW-ROOT-PASSWORD”) where User=’root’;
5. flush privileges;
6. quit
然后,关闭mysql 服务
5.7 mysql的密码字段改名了
“password” => "authentication_string"
相关文章推荐
- MySQL数据库小结---待完善
- MySql错误代码1045的解决方案
- MySQL安装之后没有MySQL数据库的原因
- MySQL通配符过滤
- 3、Mysql常见的索引类型
- mysql安装以及启动小问题总结
- mysql使用总结
- sysbench安装、对Mysql压力测试、结果解读及mysql数据库跟踪优化
- sysbench安装、对Mysql压力测试、结果解读及mysql数据库跟踪优化
- 实战:INNOBACKUPEX for mysql 5.6自己主动备份脚本
- MySql 数据库的练习。
- MySQL-安装 启动 运行
- 关于MySQL数据中复合组件自增长的问题
- mysql_insert_id
- Mysql载入大量数据(load data infile)的优化过程
- 系统重装后恢复MySQL数据库文件
- 理解MySQL——索引与优化
- mysql 新增用户并设置权限
- mysql的key和index
- mysql-5.7.11-winx64.zip安装