mysql 创建user

创建

基本语法
create user 'username'@'host' identified by 'pwd'
创建可从任意主机登录的用户
create user 'username'@'%' identified by 'pwd'

授权

基本语法
grant all privileges on dbname.tablename to 'username'@'host' identified by 'pwd'
将某个数据库的所有表的权限授予用户
grant all privileges on dbname.* to 'username'@'host' identified by 'pwd'
将所有数据库的所有表的权限授予用户
grant all privileges on *.* to 'username'@'host' identified by 'pwd'

你可能感兴趣的:(mysql 创建user)