mysql权限

允许myuser使用mypassword从任何主机连接到mysql服务器
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;

 

允许用户myuser从ip为10.22.4.45的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'10.22.4.45' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUASH PRIVILEGES;

 

允许myuser从ip为10.22.4.45的主机连接到mysql服务器的test数据库,并使用mypassword作为密码;
GRANT ALL PRIVILEGES ON test.* TO 'myuser'@'10.22.4.45' IDENTIFIED BY 'mysqlpassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
posted on 2015-03-07 16:37  Andy Niu  阅读(293)  评论(0编辑  收藏  举报