access denied for user 'root'@'localhost' (using password: YES)
来源:互联网 发布:网络安全法 pdf 编辑:程序博客网 时间:2024/05/28 15:07
找了很多资料,都是老版本,全部尝试了一遍,没几个能用的,什么mysqld_safe修改大法等,MYSQL 5.7(平台为CentOS 7 x64)根本就没这个指令
通过自行摸索,终于解决该问题
先定位my.cnf文件
[root@localhost /]# find . -name my.cnf
./etc/my.cnf
# vi ./etc/my.cnf
在[mysqld]栏位末端加入以下参数
skip-grant-tables
然后重启mysql
# systemctl stop mysqld.service
# systemctl start mysqld.service
以上操作后mysql可以正常登陆
# mysql -u root -p
提示输入密码时,直接按回车
[root@localhost php]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.9 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql
如果root用户已经过期,请启用
mysql> update user set password_expired='N' where user='root';
修改root用户密码 --注意:网上很多都是改password栏位,事实上在5.7里面根本没有这个栏位,密码是记录在authentication_string
mysql> update user set authentication_string=PASSWORD('password') where user='root';
修改完后,到my.cnf文件注释掉skip-grant-tables重启MYSQL后即可
0 0
- #1045 - Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES) 问题解决
- 解决'Access denied for user 'root'@'localhost' (using password: YES)'
- access denied for user 'root'@'localhost' using password yes
- access denied for user 'root'@'localhost' using password yes
- 1045 access denied for user 'root'@'localhost' using password yes
- Access denied for user 'root'@'localhost' (using password: YES)解决办法
- Access denied for user: 'root@localhost' (Using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password:YES) 解决方案
- mysql Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password:YES)
- #1045 - Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- mysql Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- MySql Access denied for user 'root'@'localhost' (using password: YES)
- 后缀自动机构造过程演示
- Java IO专题
- Factor Oracle自动机的构造
- 八大排序算法的 Python 实现
- 一名合格的测试员应具备的素质
- access denied for user 'root'@'localhost' (using password: YES)
- 差分约束系统
- Javap学习
- 0010用顺序表实现约瑟夫环(Josephus)问题
- windows核心编程之用户方式中的线程同步
- Android Service总结
- 谈谈JS的全局变量跟局部变量
- Java的字节代码
- ubuntu安装配置postgreSQL