Create User - mysql

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Create User - mysql相关的知识,希望对你有一定的参考价值。

Create User


MariaDB [(none)]> CREATE USER ‘DBAdmin‘@‘%‘ IDENTIFIED BY ‘mypasswd‘;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> CREATE USER ‘tdtc2014‘@‘localhost‘ IDENTIFIED BY ‘qazxsw‘;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO ‘DBAdmin‘@‘%‘ WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT SELECT,INSERT,UPDATE,DELETE ON carnumber.* TO ‘tdtc2014‘@‘localhost‘;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> show grants for ‘DBAdmin‘;
+-----------------------------------------------------------------------------------------------------------------------------------+
| Grants for [email protected]%                                                                                                              |
+-----------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO ‘DBAdmin‘@‘%‘ IDENTIFIED BY PASSWORD ‘*8640888BFB179C50EF0B4DE12251E66B4FB18A77‘ WITH GRANT OPTION |
+-----------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> \q
Bye

以上是关于Create User - mysql的主要内容,如果未能解决你的问题,请参考以下文章

Create User - mysql

mysql重建某个用户账号(ERROR 1396 (HY000): Operation CREATE USER failed)

MySQL CREATE/DROP USER 返回 0

sql 来自https://dev.mysql.com/doc/refman/5.7/en/create-user.html

Mysql创建新用户方法

如何修复 ERROR 1726 (HY000):存储引擎“MyISAM”不支持系统表。在 CREATE USER 之后的 Mysql 8.0