修复:错误 1396 (HY000):MySQL 中的操作 CREATE USER 失败?

数据库数据库 2023-08-31 03:28:54 844
摘要: Tofixtheerror,letusseehowtocreateausercorrectly.Letuscreateauser−mysql>createuser'Emma'@'localhost'IDENTIFIEDBY'emma_654';QueryOK,0rowsaffect...

修复:错误 1396 (HY000):MySQL 中的操作 CREATE USER 失败?

To fix the error, let us see how to create a user correctly. Let us create a user −

mysql> create user 'Emma'@'localhost' IDENTIFIED BY 'emma_654';
Query OK, 0 rows affected (0.00 sec)

Let us display all users along with host −

mysql> select user,host from MySQL.user;

这将产生以下输出。上面创建的新用户在下面的所有用户列表中可见,以及主机−

+------------------+-----------+
| user             |      host |
+------------------+-----------+
| Bob              |         % |
| Charlie          |         % |
| Robert           |         % |
| User2            |         % |
| mysql.infoschema |         % |
| mysql.session    |         % |
| mysql.sys        |         % |
| root             |         % |
| @UserName@       | localhost |
| Adam             | localhost |
| Adam Smith       | localhost |
| Chris            | localhost |
| David            | localhost |
| Emma             | localhost |
| Jace             | localhost |
| James            | localhost |
| John             | localhost |
| John Doe         | localhost |
| Michael          | localhost |
| Mike             | localhost |
| Robert           | localhost |
| User1            | localhost |
| am               | localhost |
| hbstudent        | localhost |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
+------------------+-----------+
26 rows in set (0.00 sec)

以上就是修复:错误 1396 (HY000):MySQL 中的操作 CREATE USER 失败?的详细内容,更多请关注其它相关文章!