赋予用户库的读写权限

一、建立用户

CREATE USER 'test'@'%' IDENTIFIED BY '15ht46389012t';  #'%' - 全部状况都能访问;‘localhost’ - 本机才能访问;’192.168.1.2‘ - 指定 ip 才能访问

 

二、赋予权限

grant all privileges on 想受权的数据库.* to 'test'@'%';
flush privileges;

    all 能够替换为 select,delete,update,create,drop。数据库

相关文章
相关标签/搜索