Announcement

Collapse
No announcement yet.

Hepsia VPS OpenVZ MySQL connection help!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hepsia VPS OpenVZ MySQL connection help!

    After I reboot the VPS, I received the following error:

    Could not connect to the database; Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

    I searched a lot of solutions and I couldn't find the ability to restart the mysql without reboot the whole vps :

    /scripts/restartsrv_mysql
    /scripts/mysqlup --force
    /scripts/mysqlconnectioncheck

    because I did not found where is the /scripts located at.

    and also I can't change the ownership to mysql :

    sudo chown -R mysql /var/run/mysqld/
    or
    sudo chown -R mysql /hosting/var/run/mysqld/

    Help @@


  • #2
    Finally I found a solution, just changed the sql connection from localhost to 127.0.0.1, the problem solved in few seconds.

    The support told me is my database file's code problem (OpenCart)
    my-opencart-software-folder/system/database/mysql.php

    I tried to rename the file, disable the url, the problem still persist. Then I start thinking again, why my other site url wordpress site got problem can be related to OpenCart ?

    Again I did research and finally I found just to simply change localhost to 127.0.0.1, then the problem solved.

    I know RSP doesn't support custom code, but don't bring me go travelling...

    1 hour downtime for rebooting the VPS. @@ but still lucky that I found the solution, so for those who choose Hepsia CP and after rebooting the VPS or D-server, if you're experiencing the MySQL problem, try this solution and hope this can save your time too.

    Comment


    • #3
      After the support escalated the issue to the administration, finally it solved, and now can use localhost as well as 127.0.0.1

      According to the support, the issue was arose from a wrong resolver within /hosting/etc/resolv.conf.

      ###################
      The problem was a wrong resolver within /hosting/etc/resolv.conf . Due to it localhost was not resolving correctly. After setting the correct record in /etc/resolv.conf , localhost begin to resolve correctly again .
      ###################

      But what I don't understood is, why after reboot the VPS, the record became mistake ?

      @@??

      Comment

      Working...
      X