mysql增加、删除用户、增加权限,mysql权限
mysql>
insert into mysql.user(Host,User,Password) values("localhost","test",password("1234"));
增加了一个用户名为test、密码为1234用户,但该用户只能在本地登陆,若想远程登陆的话可将localhost改为%表示任何一台电脑都可以登陆,或改为特定的ip表示只能在特定的ip地址上登陆。
mysql>grant all privileges on testDB.* to test@localhost identified by
'1234';
表示给用户test在本地登陆时增加了对testDB数据库的所有表的任何操作。若想指定权限的话,可将all privileges修 改为select或update或delete或三者的组合;若想指定表的权限,可以将testDB.*修改为testDB.info表示可对testDb数据库中的info表进行操作;若想指定访问的地址,可将@%修改为localhost表示用户test只能在本地进行对数据库的操作。
mysql>flush privileges;
mysql>Delete FROM user Where User='test' and Host='localhost';
mysql>drop user 用户名@'%';
mysql>update mysql.user set password=password('新密码') where User="test"
and Host="localhost";
http://www.htsjk.com/shujukunews/6960.html
www.htsjk.Com
true
http://www.htsjk.com/shujukunews/6960.html
NewsArticle
mysql增加、删除用户、增加权限,mysql权限 创建用户 mysql insert into mysql.user(Host,User,Password) values( localhost ,test,password(1234)); 增加了一个用户名为test、密码为1234用户,但该用户只能在本地...
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。