Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

MySQL Connection Issues

Discussion in 'Database Discussion' started by Jallekobber, Mar 14, 2018.

  1. Jallekobber

    Jallekobber Member

    Joined:
    Jul 12, 2012
    Messages:
    23
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    So I have created a remote database with the use of cPanel and I can connect to the database remotely over my other servers.

    The problem exists where I try to edit anything from the database with use of a web application. I used a some hours to read up on what it might be and I read that there was something called MySQL resource limits? Does WHM / cPanel limit the use of MySQL?

    The reason why I am writing here is because I think it's a cPanel issue. I have a firewall in place but it's working correctly as I can connect from my servers via the MySQL commandline to the database.

    The following error is what I'm experiencing when I boot my panel or program:
    production.ERROR: PDOException: SQLSTATE[HY000] [2002] Connection timed out in

    Full error log of my program:

    hastebin

    Thank you in advance and I hope I posted it in the correct forum.

    Regards, Jacob
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi Jacob,

    MySQL limits are not imposed by the cPanel & WHM software unless you are using a third-party application such as MySQL Governor with CloudLinux. Do you notice any output to the MySQL error log when this happens? It's located at /var/lib/mysql/$hostname.err. Also, what settings are you using in your /etc/my.cnf file?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Jallekobber

    Jallekobber Member

    Joined:
    Jul 12, 2012
    Messages:
    23
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Dear Michael.

    Thank you for your response.

    I have looked through the log of the server and I only see a lot of:

    [Warning] IP address 'XX.XX.XX.XX' has been resolved to the host name 'Different IP', which resembles IPv4-address itself.


    is this a bad or good thing? There's thousands of lines of this just in one day.

    This is the my.cnf config:

    [mysqld]
    innodb_file_per_table=1
    default-storage-engine=MyISAM
    performance-schema=0
    max_allowed_packet=268435456
    open_files_limit=10000


    Thank you in advance.

    Regards, Jacob
     
    #3 Jallekobber, Mar 14, 2018
    Last edited: Mar 15, 2018
  4. Jallekobber

    Jallekobber Member

    Joined:
    Jul 12, 2012
    Messages:
    23
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    P.S I whitelisted the resolved IP and now it works. Do you have any idea why this is happening? I am using a VPS from OVH.
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    The output you posted from the MySQL error log is just a warning and shouldn't lead to the issue you have described.

    That suggests the IP address hosting the application was restricted by your firewall rules. It's likely port 3306 is blocked (this is common in firewall rules), and thus allowing the remote IP address let it make the connection.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Jallekobber

    Jallekobber Member

    Joined:
    Jul 12, 2012
    Messages:
    23
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Dear Michael.

    Thank you for the update. I had already added the servers real IP address but it was after adding the resolved IP:

    Which I saw no where listed as my servers IP address.
     
    #6 Jallekobber, Mar 14, 2018
    Last edited: Mar 15, 2018
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    The warning message you referenced actually does appear to be related to the issue, as it looks like this is due to the RDNS record configured for that specific IP address. There's some background information on this topic at:

    MySQL Bugs: #81132: MySQL doesn't allow access to host names that are just numeric

    Generally, the best way to solve this issue would be to reach out to the provider that handles the referenced IP address and to request an update to the RDNS record so it points to an actual hostname. Or, as you already did, you could whitelist the hostname itself.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Jallekobber

    Jallekobber Member

    Joined:
    Jul 12, 2012
    Messages:
    23
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Dear Michael.

    Weird that it's the first time I hear this. I will make sure that happens in the future and try to spread the word because I have never seen this before regarding MySQL.

    Thank you so much for your insider knowledge. Great to have cPanel as a friendly support!

    Kind regards,

    Jacob.
     
    cPanelMichael likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice