Cpanel and MYSQL in big mess up??

Frankc

Well-Known Member
Jun 18, 2005
105
1
168
Our production server ran on automatic updates for cpanel etc.

Mysql 4.1 and WHM 11.30 (build 23)

Migrated to new server and ran into a lot of problems.

MySQL 5.1 and WHM 11.30 (build 23)

Except for of course many client scripts that now don't work with the MYSQL 5.1 the problem with cpanel is that it don't sync properly with whm/cpanel.

Go to cpanel, click on mysql databases but get answer tht mysql is currently offline it's NOT)

Try to go to phpmyadmin but it won't accept the password. Changed the password for client account in WHM and go back and try connect to phpmyadmin, #1045 Cannot log in to the MySQL server.

Any ideas please?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello :)

Could you post the output of the cPanel error log when when you receive the "mysql is currently offline" message in cPanel:

Code:
/usr/local/cpanel/logs/error_log
For more immediate assistance, please feel free to open a support ticket up via:

Submit A Ticket

If you choose to open a ticket, please post the ticket number here.

Thank you.
 

Frankc

Well-Known Member
Jun 18, 2005
105
1
168
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
The mysql server is offline.[2011-06-01 10:12:03 +0200] warn [cpanel] Cpanel::AdminBin::adminrun(cpmysql) set error in context mysql
[2011-06-01 10:12:03 +0200] warn [mysql::initcache] Encountered error in mysql::initcache: The mysql server is offline.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
cphulkd rejected registration attempt for webmaild with: 500 AUTH FAILED
Also have other messages similar to

/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
Interesting

[2011-06-01 10:10:57 +0200] warn [whostmgr] Unable to determine MySQL data directory from mysqladmin variables. at /usr/local/cpanel/Cpanel/MysqlUtils.pm line 109
Cpanel::MysqlUtils::getmysqldir() called at whostmgr/bin/whostmgr line 6781
main::doresetmysqlroot('nohtml', 1, 'exit', 1) called at whostmgr/bin/whostmgr line 285
cphulkd rejected registration attempt for cpaneld with: 400 Unable to connect to database backend: Failed to connect to mysql db: cphulkd
I actually WORK on things that require database access and it's fine, but every now and then get cannot connect to mysql error (but if I click refresh immediately, the page loads so it couldn't be that mysql was really down as it won't restart so quickly)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
I have seen several different causes for the error messages you have posted. You may find more information in the MySQL error log itself, which is found at:

Code:
/var/lib/mysql/$hostname.err
Simply replace "$hostname" with the hostname of your server.

I suggest opening a ticket so we may access your server to check further:

Submit A Ticket

Thank you :)
 

Frankc

Well-Known Member
Jun 18, 2005
105
1
168
We get our servers from Netdepot and submitted a ticket (refered to this forum)

The error log show the following over and over again about every 2 minutes.

110601 12:36:28 mysqld_safe mysqld from pid file /var/lib/mysql/mercury.sa-hosting.net.pid ended
110601 12:36:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110601 12:36:46 [Warning] /usr/sbin/mysqld: Option '--set-variable' is deprecated. Use --variable-name=value instead.
110601 12:36:46 [Warning] '--log_slow_queries' is deprecated and will be removed in a future release. Please use ''--slow_query_log'/'--slow_query_log_file'' instead.
110601 12:36:46 [Warning] '--safe-show-database' is deprecated and will be removed in a future release. Please use 'GRANT SHOW DATABASES' instead.
110601 12:36:46 [Note] Plugin 'FEDERATED' is disabled.
110601 12:36:46 InnoDB: Initializing buffer pool, size = 8.0M
110601 12:36:46 InnoDB: Completed initialization of buffer pool
110601 12:36:46 InnoDB: Started; log sequence number 0 3255950
110601 12:36:46 [Note] Event Scheduler: Loaded 0 events
110601 12:36:46 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.56-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
110601 12:41:29 [Note] /usr/sbin/mysqld: Normal shutdown

110601 12:41:29 [Note] Event Scheduler: Purging the queue. 0 events
110601 12:41:31 InnoDB: Starting shutdown...
110601 12:41:36 InnoDB: Shutdown completed; log sequence number 0 3256986
110601 12:41:36 [Note] /usr/sbin/mysqld: Shutdown complete
 

Frankc

Well-Known Member
Jun 18, 2005
105
1
168
Some databases and users are not mapped correctly. Tried to user database map tool in WHM

aidtcgdf_admin does not exist in the database

aidtcgdf_root does not exist in the database

/usr/bin/mysqladmin: connect to server at 'localhost' failed

error: 'Access denied for user 'root'@'localhost' (using password: YES)'
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
This suggests the stored password used by the cPanel & WHM utilities is incorrect. This password is stored in /root/.my.cnf. if you know your root password for MySQL, you can visually inspect it for correctness. if it is not correct changing it in /root/.my.cnf should resolve the matter.

You might also resolve this by executing /usr/local/cpanel/scripts/mysqlconnectioncheck
 

Frankc

Well-Known Member
Jun 18, 2005
105
1
168
Your Request id is: 1560934

This fixed several issues thanks Kenneth.

I however opened a support ticket because there are still some errors that seems like sync between mysql and cpanel and it's perhaps better if your guys have a look.

Regards