`
Lstoryc
  • 浏览: 76108 次
文章分类
社区版块
存档分类
最新评论

MySql 设置远程登录权限

 
阅读更多
//创建数据库samDatabase,如果已有数据库,不需要此操作
mysql>create database samDatabase
//授权user1用户拥有samDatabase数据库的所有权限,但只能在本地访问。
mysql>grant all privileges on samDatabase.* to 'user1'@localhost identified by 'yourpassword';
//刷新系统权限表
mysql>flush privileges;

//指定部分权限给user1
mysql>grant select,update on samDatabase.* to 'user1'@localhost identified by 'yourpassword';
mysql>flush privileges;

//设置user1用户远程访问samDatabase数据库
mysql>grant all privileges on samDatabase.* to 'user1'@'%' identified by 'yourpassword';
mysql>flush privileges;

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics