Unable to add user to database

kodeslogic

Well-Known Member
Apr 26, 2020
327
126
118
IN
cPanel Access Level
Root Administrator
Assuming you have root-level access. The first thing to check if there is an error in the file /usr/local/cpanel/logs/error_log when you do that.
 
Mar 1, 2021
15
0
1
Pulchowk
cPanel Access Level
Root Administrator
same issue. It shows " User “aniket_testuser” could not be added to the database “aniket_testdb”. The request failed. (Error ID: ww9ydv) Ask your hosting provider to research this error in cPanel & WHM’s main error log."
 
Mar 1, 2021
15
0
1
Pulchowk
cPanel Access Level
Root Administrator
Assuming you have root-level access. The first thing to check if there is an error in the file /usr/local/cpanel/logs/error_log when you do that.
Here is the error log

```
[2021-06-01 04:42:05 +0100] info [] Quota file /home/beautyst/etc/beautystorenepal.com/quota does not exist; skipping
[2021-06-01 04:42:58 +0100] info [] Quota file /home/beautyst/etc/beautystorenepal.com/quota does not exist; skipping
[2021-06-01 04:43:02 +0100] info [cpwrapd] Creating MySQL database beautyst_testdb for user beautyst
[2021-06-01 04:43:04 +0100] info [] Quota file /home/beautyst/etc/beautystorenepal.com/quota does not exist; skipping
[2021-06-01 04:44:32 +0100] info [cpwrapd] Creating MySQL virtual user beautyst_testuser for user beautyst
[2021-06-01 04:44:32 +0100] warn [cpwrapd] Error from MySQL query: (XID 88z7fx) The system received an error fromthe “MySQL” database “mysql”: ER_CANNOT_USER (Operation CREATE USER failed for 'beautyst_testuser'@'rs12uk.01cloud.com') at /usr/local/cpanel/Cpanel/Mysql/Basic.pm line 363.
Cpanel::Mysql::Basic::sendmysql(Cpanel::Mysql=HASH(0x398c0b0), "CREATE USER 'beautyst_testuser'\@'RS12UK.01cloud.com' IDENTIFI"...) called at /usr/local/cpanel/Cpanel/Mysql/Passwd.pm line 160
Cpanel::Admin::Base::DB::CREATE_USER(Cpanel::Admin::Modules::Cpanel::mysql=HASH(0x34fb998), "beautyst_testuser", "xxxxxxxx") called at /usr/local/cpanel/Cpanel/Admin/Base.pm line 717
[2021-06-01 04:44:32 +0100] warn [cpwrapd] GRANT statement “CREATE USER 'beautyst_testuser'@'RS12UK.01cloud.com' IDENTIFIED BY 'xxxxxxxx';” failed: at /usr/local/cpanel/Cpanel/Mysql/Passwd.pm line 160.
Cpanel::Admin::Base::DB::CREATE_USER(Cpanel::Admin::Modules::Cpanel::mysql=HASH(0x34fb998), "beautyst_testuser", "xxxxxxxx") called at /usr/local/cpanel/Cpanel/Admin/Base.pm line 717
[2021-06-01 04:44:36 +0100] info [] Quota file /home/beautyst/etc/beautystorenepal.com/quota does not exist; skipping
Cpanel::Exception::Database::Error/(XID rm6ztn) The system received an error from the “MySQL” database “mysql”: ER_CANNOT_USER (Operation CREATE USER failed for 'beautyst_testuser'@'rs12uk.01cloud.com')
Cpanel::Mysql::_do_addusertodb(Cpanel::Mysql=HASH(0x2863128), "beautyst_testuser", "beautyst_testdb", "ALL") called at /usr/local/cpanel/Cpanel/Mysql.pm line 626
Cpanel::Mysql::addusertodb_literal_privs(Cpanel::Mysql=HASH(0x2863128), "beautyst_testuser", "beautyst_testdb", ARRAY(0x28651d0)) called at /usr/local/cpanel/Cpanel/Admin/Modules/Cpanel/mysql.pm line 194
Cpanel::Admin::Modules::Cpanel::mysql::SET_USER_PRIVILEGES_ON_DATABASE(Cpanel::Admin::Modules::Cpanel::mysql=HASH(0x34ffbb0), "beautyst_testuser", "beautyst_testdb", ARRAY(0x28651d0)) called at /usr/local/cpanel/Cpanel/Admin/Base.pm line 717
[2021-06-01 04:46:17 +0100] info [] Quota file /home/beautyst/etc/beautystorenepal.com/quota does not exist; skipping
```