一、创建用户的命令
mysql> create user 'username'@'localhost' identified by 'password';
Query OK, 0 rows affected (0.06 sec)
二、给新加用户授予权限
mysql> grant all privileges on test.* to 'username'@'localhost';
Query OK, 0 rows affected (0.00 sec)
说明:这条命令授予 username 对数据库 test 的全部权限(DDL和DML 表的创建、修改及删除和表中记录的增、删、改、查)。
mysql 添加用户的命令
最新推荐文章于 2022-04-07 09:35:32 发布