LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (http://www.linuxquestions.org/questions/linux-server-73/cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mysqld-sock-753632/)

Burningmace 09-08-2009 02:30 PM

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
 
My website's hosting is throwing the following error when trying to connect via a subdomain using 'localhost' as the MySQL host:

Code:

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
On other subdomains, we connect to MySQL using the full URL (e.g. forums.domain.com) but when I do that with this new domain I get the following error:

Code:

Lost connection to MySQL server at 'reading initial communication packet', system error: 111
I also tried using "domain.com" as the server, and that also resulted in an error 111.

Any ideas?

alexroux 09-09-2009 03:27 AM

The first error (2 -> No such file or directory ) comes from the fact that you have no mysql server running on localhost.

The second one (111 -> Connection refused) shows that either mysql port is blocked (firewall for instance) or that no mysql server is running on forums.domain.com.

Are you sure that the machine with mysql server is reachable from your new subdomain? If not, you have found your problem. Be also sure to use the correct url to join the mysql server.

Burningmace 09-10-2009 05:15 AM

For some reason when we deleted the schema and the associated MySQL account from their control panel and then re-created it, it worked fine. Doesn't really make any sense at all, but our hosting is often quite glitchy with stuff like this. I get the feeling that the config files weren't updated properly to allow access to the other domain.

xiutuo 09-11-2009 12:41 AM

I think there are two mysql server...
and the lib file: libmysqlclient.so** at the same path .
1. mysql server one: install by yum or rpm with os cdrom
2. mysql server two: install by source...
there are infilct between the mysqlclient.so

rbucks 09-09-2011 11:12 AM

check df
 
Hey guys, I had this problem and googled and googled. Then I ran df and saw that my disk was 100% full. So test that before you pull any more hair out.

This was the error I had that wouldn't let me get into MySQL. I couldn't find mysqld.sock because the system had no disk space to write it!

error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)'

SunnyDaze 09-06-2012 01:29 AM

I was suspecting a full root file system was causign all my problems. When I saw rbucks comment, I knew my instincts must be right, so I went on a quest to remove files that were no longer needed. On my Ubuntu 10.04 system, this simple command cleared up over 400Meg of files that no longer were needed, and got the system up an running.

Code:

sudo apt-get autoremove


All times are GMT -5. The time now is 11:31 AM.