CREATE DATABASE IF NOT EXISTS dbname DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create user 'user'@'%' identified by 'pwd';
GRANT ALL PRIVILEGES ON dbname.* TO 'user'@'localhost' IDENTIFIED BY 'pwd';
FLUSH PRIVILEGES;
查看用户权限
show grants for user@'localhost';
网友评论