Skip to main content

WHM cannot communicate with MySQL

Comments

4 comments

  • cPanelMichael
    Encountered error in Mysql::initcache: Mysql::initcache() failed: Timeout: Alarm

    Hello, Can you try disabling the "Use INFORMATION_SCHEMA to acquire MySQL disk usage" option under the "SQL" tab in "WHM >> Tweak Settings" and verify if accessing the MySQL Databases option in cPanel continues to issue an error message? Thank you.
    0
  • thepossum
    Can you try disabling the "Use INFORMATION_SCHEMA to acquire MySQL disk usage" option under the "SQL" tab in "WHM >> Tweak Settings" and verify if accessing the MySQL Databases option in cPanel continues to issue an error message?

    That was one of the many suggestions from these forums. At first it was complaining about an upgrade in progress, which was apparently running (and stalled). Even after a reboot the error message for THAT didn't go away, until I figured out that I had to rename the /usr/local/cpanel/upgrade_in_progress.txt file. After doing that, I retried the Tweak Settings above, and "Use INFORMATION_SCHEMA to aquire MySQL disk usage" is set to "Off". This did NOT allow me to access the MySQL databases via WHM, the same timeout issue is still occurring.
    0
  • cPanelMichael
    Hello, Could you open a support ticket using the link in my signature so we can take a closer look? Thank you.
    0
  • thepossum
    I'm not going to fully declare this "solved" yet, at least not until staff has gotten in later today to complete their own work. The problem was apparently a "too many chefs" sysadmin problem. Somebody unknown had taken it upon themselves to firewall tcp port 3306 to only allow a specific /24 subnet, but had not also explicitly allowed 127.0.0.1 The symptoms then were that the first command line would work, but not the second (which would just time out):
    mysql -u root -hlocalhost -p mysql -u root -h127.0.0.1 -p
    The difference being that with mysql, the service interprets "localhost" as communication via a filesystem socket, and "127.0.0.1" as tcp to 3306. Unlike MOST services, for mysql "localhost" and "127.0.0.1" are NOT equivalent and interchangeable. The solution then was to explicitly allow 127.0.0.1; the easiest way being to simply delete that last "REJECT" rule and append the new entries:
    /sbin/iptables -D INPUT -p tcp --dport 3306 -j REJECT /sbin/iptables -A INPUT -p tcp --dport 3306 -s 127.0.0.1 -j ACCEPT /sbin/iptables -A INPUT -p tcp --dport 3306 -j REJECT
    0

Please sign in to leave a comment.