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
/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