News:

Wondering if this will always be free?  See why free is better.

Main Menu

Can't connect to local MYSQL server through socket

Started by f00ty, May 28, 2014, 12:53:11 AM

Previous topic - Next topic

f00ty

Hi,

I get about 10-20 messages a day to my error log:
Quote
2: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (11)

File: /home/www/mysite/Themes/mytemplate/index.template.php
Row: 328

It happens randomly to users, and to me also sometimes. Because of this, some of the messages won't be sent etc. How to correct this issue? Notice that this doesn't happen all the time, it happens randomly.

kat

Best I can offer, at this stage, is for you to check the MySQL log, to see if the server's actually running and/or if it's crashed/isn't ready to accept connections for whatever reason(s).

Probably one for your host...?

Oldiesmann

Question. Why are you trying to connect to the database in a template file? That should never happen (and that code is certainly not in a default installation of SMF).
Michael Eshom
Christian Metal Fans

f00ty

Unfortunately I don't have an option to view MySQL logs (shared hosting).

Woops, it's my custom (******ty) code. My apologies.

Advertisement: