您好,欢迎访问一九零五行业门户网

mysql创建用户_MySQL

bitscn.com
grant all privileges on *.* to username@'%' identified by password
分配远程username所有库的访问权限。
任何数据库的任何表到用户username使用密码password。
1 grant all privileges on test_db.* to user1@192.168.1.3 identified by password
2 grant all privileges on test_db.* to user2@192.168.1.% identified by password
3 grant all privileges on test_db.* to user3@192.168.1.0/10 identified by password
很明显,第一句是分配用户user1只能在192.168.1.3上访问。第二句是在192.168.1网段内都能访问。第三句是ip  0-10范围内的。
删除用户:
delete from user where user=username and host=localhost;
最后别忘了这句.
flush privileges;
bitscn.com
其它类似信息

推荐信息