linux mysql用户授权

上来先关闭防火墙,血一般的教训,在这经常耽误很长时间找不出问题所在

service iptables stop;

查看用户授权表

select user,host,password from mysql.user;


从服务器登录主服务器

mysql -u root -p123456 -h192.168.10.1

授权所有库所有表的权限给ip为192.168.10.2的用户user1,切记是user1可以从192.168.10.2这台从服务器登录主服务器

 grant all on *.* to [email protected] identified by "456";

show grants for [email protected];
查询当前所在数据库

select database();

create table t1(id int)创建表

desc t1查看表

猜你喜欢

转载自1207368746.iteye.com/blog/2124748