
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Fix: ERROR 1396 (HY000): Operation CREATE USER failed in MySQL?
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;
This will produce the following output. The new user created above is visible in the below list of all users along with 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)
- Related Articles
- ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'localhost'?
- Solve ERROR 1396 (HY000): Operation DROP USER failed for 'user'@'localhost' in MySql?
- Fix MySQL Database Error #1064?
- Fix ERROR 1093 (HY000): You can't specify target table for update in FROM clause while deleting the lowest value from a MySQL column?
- Fix ERROR 1064 (42000) while creating a database in MySQL?
- Fix Error with TYPE=HEAP for temporary tables in MySQL?
- Fix Drop table view #1051 unknown table error in MySQL
- Fix error in MySQL “select ClientId,ClientName,ClientAge, from tablename”
- MySQL Error ERROR 1099 (HY000): Table was locked with a READ lock and can't be updated
- Fix MySQL Error #1064 - You have an error in your SQL syntax… near 'TYPE=MyISAM?
- Error Failed to load resource in SAPUI5 application
- Fix Error in MySQL syntax while creating a table column with name “index”?
- MongoDB – Fix “Failed to convert from type String to type Date”?
- Why the #1054 - Unknown column error occurs in MySQL and how to fix it?
- Setting detailed error notification about failed login in SAP HANA

Advertisements