mysql Access denied for user 'root'

来源:互联网 发布:java 键盘输入 编辑:程序博客网 时间:2024/06/07 10:24
service mysqld stop
/usr/bin/mysqld_safe --skip-grant-tables
mysql -u root //无密进入
set global read_only=0;//关掉只读属性
flush privileges;
//Access denied for user 'root'@'localhost'
grant all privileges on *.* to 'root'@'localhost' identified by 'passwd';
//Access denied for user 'root'@'xxx.xxx.xxx.xxx'
grant all privileges on *.* to root@'%' identified by 'passwd';
set global read_only=1;//打开
flush privileges;
service mysqld restart
原创粉丝点击