When I try to connect the MySQL database that is on my Mac to a website, I get the following error:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
That is when I put localhost
as the servername.
When I put 127.0.0.1
as the servername, I receive the following error:
Can't connect to MySQL server on '127.0.0.1' (13)
The following Stack questions did not work for me: Cannot connect to mysql with 127.0.0.1 error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'