Unable to create a database user in MySQL

Created:

2016-11-16 13:22:36 UTC

Modified:

2017-08-08 13:39:52 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to create a database user in MySQL

Applicable to:

  • Plesk

Symptoms

Database creation failed with error:

Unable to create a database user:
Access denied for user 'root'@'%' to database 'data\\_base'

Cause

Insufficient permissions for MySQL root user

Resolution

Connect to the affected MySQL server with superuser privileges

mysql> USE mysql;

mysql> UPDATE user SET
Select_priv='Y', Insert_priv='Y', Update_priv='Y',Delete_priv='Y',
Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y',
Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y',
Index_priv='Y', Alter_priv='Y', Show_db_priv='Y', Super_priv='Y',
Create_tmp_table_priv='Y', Lock_tables_priv='Y', Execute_priv='Y',
Repl_slave_priv='Y', Repl_client_priv='Y', Create_view_priv='Y',
Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y',
Create_user_priv='Y', Event_priv='Y'
WHERE User='MYSQL_ADMIN_USER';

mysql> FLUSH PRIVILEGES;
Have more questions? Submit a request
Please sign in to leave a comment.