1、查看对应的权限(把表清空)
select user,host from mysql.user;
mysql> d.1';
Query OK, 1 row affected (0.00 sec)elete from user where host='127.0.0
mysql> delete from user where host='make.spark.com';
Query OK, 2 rows affected (0.00 sec)
mysql> delete from user where host='localhost';
2、设置用户连接
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
注释:
*.*:数据库.表明
%:任意的ip都可以登录
identified by '123456':使用123456密码登录
3、刷新权限设置
flush privileges;
4、重启mysql服务
service mysqld restart
select user,host from mysql.user;
mysql> d.1';
Query OK, 1 row affected (0.00 sec)elete from user where host='127.0.0
mysql> delete from user where host='make.spark.com';
Query OK, 2 rows affected (0.00 sec)
mysql> delete from user where host='localhost';
2、设置用户连接
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
注释:
*.*:数据库.表明
%:任意的ip都可以登录
identified by '123456':使用123456密码登录
3、刷新权限设置
flush privileges;
4、重启mysql服务
service mysqld restart