1

After installing the configuration began, however I kept getting this message saying:

 An error occurred while installing the database:                                
  │                                                                                 
  │ ERROR 2002 (HY000): Can't connect to local MySQL server through socket          
  │ '/var/run/mysqld/mysqld.sock' (2)         

I am new to this not sure what is blocking the mysql socket

1

Sounds like a typical permission problem, you need to ensure that your permissions can correctly read and write the database sock file.

Source

If your file my.cnf (usually in the /etc/mysql/ folder) is correctly configured with:

socket=/var/lib/mysql/mysql.sock 

You can check if mysql is running with the following command:

mysqladmin -u root -p status 

Try changing your permission to mysql folder. If you are working locally, you can try:

sudo chmod -R 755 /var/lib/mysql/

If the above doesn't fix the problem then its likely something else, Visit Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38) on Stack Overflow for more answers.

  • seems like it has worked (y) ` mysqladmin -u root -p status Enter password: mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'` then setting the permission: mysqladmin -u root -p status Enter password: Uptime: 4067 Threads: 3 Questions: 3055 Slow queries: 0 Opens: 163 Flush tables: 1 Open tables: 156 Queries per second avg: 0.751 – Ciasto piekarz Sep 13 '16 at 12:46
0

That's an error in configuration. You need to put localhost or your IP in it.

Follow this steps:

  1. Open /etc/mysql/my.cnf.
  2. Find bind-address, and change its value to the database server host machine's IP address. localhost or 127.0.0.1
  3. Save and close the file.
  4. Restart apache
  • this is already bind-address = 127.0.0.1 although machine IP is 10.10.10.4 which is going to change in future when I change the router. – Ciasto piekarz Sep 13 '16 at 12:23

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.