problem creating a new mysql user in cpanel

wowrack

Member
PartnerNOC
Dec 18, 2009
6
0
51
Hi,

I've tried to created a new user in the MySQL database section of the cpanel. It let's me create a database, but a problem occurred when adding a new user.
When I press the "Create User" button, i got :

Added user xxx with the password xxx

Bun when I click "Go Back", I can't find user xxx in the Current Users table at the bottom.

I've tried this multiple times and I still got the same problem.
Can you help me out with this?
Any help would be appreciated.

Thank you. :)
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Hi,

I've tried to created a new user in the MySQL database section of the cpanel. It let's me create a database, but a problem occurred when adding a new user.
When I press the "Create User" button, i got :

Added user xxx with the password xxx

Bun when I click "Go Back", I can't find user xxx in the Current Users table at the bottom.

I've tried this multiple times and I still got the same problem.
Can you help me out with this?
Any help would be appreciated.

Thank you. :)
To help diagnose and troubleshoot the issue, please let us know the following information, (numbered for clarity):
1.) What is the full cPanel version and build number?
2.) Does phpMyAdmin load OK via root access to WHM?
3.) Does phpMyAdmin load OK via the end-user's cPanel while logged-in using their cPanel username and password?
4.) Is there a MySQL root password set?

For reference, the full cPanel version and build number may be obtained using the following command via SSH access:
Code:
# cat /usr/local/cpanel/version && echo
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
To help diagnose and troubleshoot the issue, please let us know the following information, (numbered for clarity):
1.) What is the full cPanel version and build number?
2.) Does phpMyAdmin load OK via root access to WHM?
3.) Does phpMyAdmin load OK via the end-user's cPanel while logged-in using their cPanel username and password?
4.) Is there a MySQL root password set?

For reference, the full cPanel version and build number may be obtained using the following command via SSH access:
Code:
# cat /usr/local/cpanel/version && echo
Adding to the above information, are there any errors or other messages logged at the same time when attempting to create the new MySQL user and also when viewing the MySQL Databases page in cPanel to list the MySQL users?

The following command may be used to monitor ("tail") the cPanel error log for new messages while testing:
Code:
# tail -fvn0 /usr/local/cpanel/logs/error_log
 

wowrack

Member
PartnerNOC
Dec 18, 2009
6
0
51
1.) What is the full cPanel version and build number?
[email protected] [~]# cat /usr/local/cpanel/version && echo
11.25.0-RELEASE_43286

2.) Does phpMyAdmin load OK via root access to WHM?
no, it doesn't

3.) Does phpMyAdmin load OK via the end-user's cPanel while logged-in using their cPanel username and password?
yes, it does

4.) Is there a MySQL root password set?
there is no MySQL root password set

5)
[email protected] [~]# tail -fvn0 /usr/local/cpanel/logs/error_log
==> /usr/local/cpanel/logs/error_log <==
DBI connect('mysql:localhost','root',...) failed: Can't connect to local MySQL s erver through socket '/var/lib/mysql/mysql.sock' (2) at /usr/local/cpanel/Cpanel /Mysql.pm line 37
[2010-02-17 09:46:18 -0800] info [mysqladmin] Not updating privileges for fremon tfair (reseller login and no password specified in ~/.my.cnf)
DBI connect('mysql:localhost','root',...) failed: Can't connect to local MySQL s erver through socket '/var/lib/mysql/mysql.sock' (2) at /usr/local/cpanel/Cpanel /Mysql.pm line 37
DBI connect('mysql:localhost','root',...) failed: Can't connect to local MySQL s erver through socket '/var/lib/mysql/mysql.sock' (2) at /usr/local/cpanel/Cpanel /Mysql.pm line 37
Can't call method "prepare" on an undefined value at /usr/local/cpanel/Cpanel/My sql.pm line 117.
DBD::mysql::st execute failed: The MySQL server is running with the --skip-grant -tables option so it cannot execute this statement at /usr/local/cpanel/Cpanel/M ysql.pm line 1136.
DBD::mysql::st fetchrow_arrayref failed: fetch() without execute() at /usr/local /cpanel/Cpanel/Mysql.pm line 1137.
[2010-02-17 09:46:35 -0800] info [mysqladmin] Not updating privileges for fremon tfair (reseller login and no password specified in ~/.my.cnf)


Thanks for your help..
 

wowrack

Member
PartnerNOC
Dec 18, 2009
6
0
51
Dear cPanelDon,

Running these commands fixed the problem.

/scripts/mysqlup --force
/usr/local/cpanel/bin/updatephpmyadmin --force
/scripts/upcp --force

thank you for your reply.

update: looks like the problem was the mysql username cannot exceed 16 characters. ex: fremontfair_pano (valid), and fremontfair_pano1 is not valid one. but there was no error msg indicating this.


Regards,
Wowrack
 
Last edited:

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Thank you for the details. If there is no MySQL root password set this will cause difficulty when using normal functions that integrate with MySQL; I recommend ensuring that there is a MySQL root password set; this may be performed via the following menu path in WHM:
WHM: Main >> SQL Services >> MySQL Root Password

I was unable to reproduce the issue regarding a long MySQL username; the text entry field in cPanel X3 used for MySQL user creation enforces a maximum of 7 characters allowed for the username. I would ensure the cPanel account is set to use the X3 theme (and not an older or legacy theme).
 

mpkossen

Member
Jul 19, 2010
12
0
51
Still an issue here:

11.26.16-CURRENT_49279

It allows only 7 characters for a username, but doesn't check the overall username character limit of 16. The database name field does this, however, it only does this at the 19th character.

So:

Database name: phpfusion_phpfusio (18) is allowed
Database name: phpfusion_phpfusion (19) is NOT allowed because "Database name cannot be longer than 16 characters."

Username: phpfusion_phpfusi (17) is allowed and apparently being created, but not really.
Username: phpfusion_phpfus (16) is allowed and being created.
 
Last edited:

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Still an issue here:

11.26.16-CURRENT_49279

It allows only 7 characters for a username, but doesn't check the overall username character limit of 16. The database name field does this, however, it only does this at the 19th character.

So:

Database name: phpfusion_phpfusio (18) is allowed
Database name: phpfusion_phpfusion (19) is NOT allowed because "Database name cannot be longer than 16 characters."

Username: phpfusion_phpfusi (17) is allowed and apparently being created, but not really.
Username: phpfusion_phpfus (16) is allowed and being created.
Thank you for the information. I would like to reproduce the issue, but I will need to know how the cPanel account was setup (where the username length is greater than 8 characters). Please clarify what method was used to create the affected cPanel account with a username longer than 8 characters. The length of a cPanel account username is normally limited to a maximum of 8 characters, assuming it was originally created directly via cPanel/WHM. Was the account transferred or migrated from a different control panel system?

If a bug is suspected please note that the best avenue to report it is via our ticket system, such as by using the link in the top-right corner of the forums, labeled Bugs; using this method to directly Submit a Bug Report helps to ensure greater efficiency during investigation, accuracy in diagnosis, and faster resolution. Thank you for your understanding.
 
Last edited:

ethical

Well-Known Member
Apr 7, 2009
97
8
58
I also see this bug. For creating both cpanel usernames and mysql databases it does not restrict me as it used too do. Am using firefox 3.6.13 and WHM 11.28.64

this was doing within the WHM interface