I tried to install Magento using XAMPP for Linux (I use 32-bit Ubuntu), I've created a database, and when you want to add via Magento Installer I get an error message like this:


I've tried a variety of ways, but it does not work, is there a solution?

  • Make sure ur Host is correct
    – Jackson
    Dec 8, 2016 at 6:13
  • @AnkitShah When I try to change the host febri , I get the following error like SQLSTATE[HY000] [2002] Connection refused Dec 8, 2016 at 6:17
  • 1
    @FebriyantoNugroho replace localhost to and then check Dec 8, 2016 at 6:19
  • 2
    Possible duplicate of PDO Exception error on index Dec 8, 2016 at 6:20
  • @ManthanDave Error result I have SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) Dec 8, 2016 at 6:21

2 Answers 2


Try to replace localhost to and check

This is commonly caused by a different instance of PHP being used by the PHP command line compared to the web server. In particular, mysql.sock might be misconfigured.

Refer this magento devdocs link http://devdocs.magento.com/guides/v2.0/install-gde/trouble/php/tshoot_phpini.html

You can also refer - PDO Exception error on index

It will works

  • Do I have to add value to the pdo_mysql.default_socket ? Dec 8, 2016 at 6:27
  • @FebriyantoNugroho after chaning localhost to now you have access denied error right ? please confirm ? Dec 8, 2016 at 6:30
  • Yes sir, of course Dec 8, 2016 at 6:32
  • @FebriyantoNugroho so now your first issue is solved , you just need to pass correct password . Check your database password with privillages and enter that password in the password field. it will works Dec 8, 2016 at 6:33
  • I'll try it later Dec 8, 2016 at 6:37

In your terminal run below command and look for MYSQL_SERVICE_PORT_33060_TCP_ADDR. You can use for your database server host.

php -i

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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