Error Can't connect to local MySQL server through socket Why How Fix Solve
- Forums
- PHP
- Error Can't connect to local MySQL server through socket Why How Fix Solve
if you are having problems connection to your mysql database when you load your php script and you get an error that says Can't connect to local MySQL server through socket i will give you some tips to troubleshoot your code [969], Last Updated: Sat May 18, 2024
bigger_travis
Mon Nov 06, 2006
0 Comments
897 Visits
the other day i was getting this error message and i wondered why do I get a MySQL "Can't connect to local MySQL server through socket" error?
Answer: This error just means that your script cannot connect to your MySQL database server. Check to make sure your mysqld server is running, if it is, try restaring your server. and if that doesnt work, check to make sure you have the correct hostname on your script. or put the ip address instead of the hostname. the most common hostname used is 'localhost' or '127.0.0.1'
Another problem you might have is that you may have your credentials incorrect. check to make sure you have the username, password, database correct. A customer of mine, changed his password and forgot to change in his configuration file and that's whay he was getting this error.