1

Please Helpme on this,I have copied a live site to a development environment so I can do some testing. I've followed this tutorial to get everything up and running.

When I go to the site is says that there has been an error. The log says the following: "SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

I have multiple other magento instances running on the same machine and they all work. The database is on a different machine.

My local.xml is all correct and when I create a simple php test page which contains the following:

<?php
      $mysqli=mysqli_connect("[same data as local.xml]");
      if(mysqli_connect_errno()){
          printf("Connect failed: %s\n", mysqli_connect_error());
          exit();
      }else{
          echo "Connection succesfull!";
      }
?>

The page is returning: Connection succesfull!

I've tried: restarting apache2 and php5-fpm, clearing cache and session folder, removing the other .xml files in /app/etc except local.xml and config.xml.

Can somebody help me fix this problem? Thanks in advance!

see link

  • Check in app/etc/local.xml database credential is correct or not? – Yogesh Trivedi Jun 13 '16 at 13:17
  • have you cleaned the var/cache folder? – simonthesorcerer Feb 13 at 22:15
0
  1. Check for the correctness of your entry made in app/etc/local.xml
  2. Check in the table "core_config_data" for if there is correct entry for the row of secure and unsecure base-url
  3. Try to replace .htaccess file present at root with the .htaccess file which comes with the bare magento version of your magento site

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.