新建用户:
identified by 后面是有户密码
MariaDB [(none)]> create user jack identified by 'jackdb';
Query OK, 0 rows affected (0.00 sec)
查看用户权限:
MariaDB [(none)]> show grants for jack;
+-----------------------------------------------------------------------------------------------------+
| Grants for jack@% |
+-----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'jack'@'%' IDENTIFIED BY PASSWORD '*0A7E2C93A6ADFE3F4894F4DB8D67D41B0CF995DE' |
+-----------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
用户授权
MariaDB [(none)]> grant select,insert,update,alter,delete on mysql.* to jack;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on *.* to jack@localhost identified by 'jackdb';