Home > Database > Mysql Tutorial > body text

Fixed: Bug 1396 (HY000): Operation CREATE USER failed in MySQL?

WBOY
Release: 2023-08-25 14:29:19
forward
1318 people have browsed it

修复:错误 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)
Copy after login

Let us display all users along with host −

mysql> select user,host from MySQL.user;
Copy after login

This will produce the following output. The new user created above is visible in the all users list below, as well as the host −

+------------------+-----------+
| 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)
Copy after login

The above is the detailed content of Fixed: Bug 1396 (HY000): Operation CREATE USER failed in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!