LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) site:http:

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2012, 11:58 AM
pooyan pooyan is offline
Senior Member
 
Join Date: Jan 2011
Posts: 130
Default Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) site:http:

I installed lsws on DA
when i run
service httpd stop
service lsws start
Also i compiled PHP via console

and test a website display this error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)


I searched on this forum and find related post and run this command but problem not fixed,

# ln /var/lib/mysql/mysql.sock /tmp
ln: creating hard link `/tmp/mysql.sock' to `/var/lib/mysql/mysql.sock': File exists



Please help me
regards
Reply With Quote
  #2  
Old 10-17-2012, 01:06 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,339
looks like /tmp/mysql.sock was already there. double check /tmp/mysql.sock make sure it is socket type file. if not, remove it and run ln command again.

Quote:
ls -l /tmp/mysql.sock
Reply With Quote
  #3  
Old 10-17-2012, 08:18 PM
cmanns cmanns is offline
Senior Member
 
Join Date: Jun 2010
Posts: 100
Quote:
Originally Posted by pooyan View Post
I installed lsws on DA
when i run
service httpd stop
service lsws start
Also i compiled PHP via console

and test a website display this error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)


I searched on this forum and find related post and run this command but problem not fixed,

# ln /var/lib/mysql/mysql.sock /tmp
ln: creating hard link `/tmp/mysql.sock' to `/var/lib/mysql/mysql.sock': File exists



Please help me
regards
Just use 127.0.0.1 for now

One thing if you don't have all dev packages for MySQL/MariaDB/PerconaDB the LiteSpeed compile will give MySQL errors. Make sure 127.0.0.1 works first (ensure your user allows connections from localhost first, it should)

You should be all set then. Also next time compile the mysql socket to the proper directory mysql creates it in...
__________________
-William C.Manns Owner of XenServ Co
Need LiteSpeed Hosting, Server Tuning, or Other Help I'm your guy

http://xenserv.com http://evilpuma.com
Reply With Quote
  #4  
Old 10-18-2012, 12:32 AM
pooyan pooyan is offline
Senior Member
 
Join Date: Jan 2011
Posts: 130
Quote:
Originally Posted by webizen View Post
looks like /tmp/mysql.sock was already there. double check /tmp/mysql.sock make sure it is socket type file. if not, remove it and run ln command again.
But it did not solve my problem.
Reply With Quote
  #5  
Old 10-18-2012, 12:34 AM
pooyan pooyan is offline
Senior Member
 
Join Date: Jan 2011
Posts: 130
Quote:
Originally Posted by cmanns View Post
Just use 127.0.0.1 for now

One thing if you don't have all dev packages for MySQL/MariaDB/PerconaDB the LiteSpeed compile will give MySQL errors. Make sure 127.0.0.1 works first (ensure your user allows connections from localhost first, it should)

You should be all set then. Also next time compile the mysql socket to the proper directory mysql creates it in...
Yes, 127.0.0.1 allowd
Reply With Quote
  #6  
Old 10-18-2012, 10:47 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,339
you can modify mysql.default_socket in php.ini (use phpinfo page to show which php.ini in use) to point to /var/lib/mysql/mysql.sock
Reply With Quote
  #7  
Old 10-18-2012, 11:13 PM
pooyan pooyan is offline
Senior Member
 
Join Date: Jan 2011
Posts: 130
Quote:
Originally Posted by webizen View Post
you can modify mysql.default_socket in php.ini (use phpinfo page to show which php.ini in use) to point to /var/lib/mysql/mysql.sock
I changed all php.ini value to mysql.default_socket = /var/lib/mysql/mysql.sock

But now after start lsws and test a website display this error:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
Reply With Quote
  #8  
Old 10-20-2012, 01:25 PM
cmanns cmanns is offline
Senior Member
 
Join Date: Jun 2010
Posts: 100
Quote:
Originally Posted by pooyan View Post
Yes, 127.0.0.1 allowd
test first with 127.0.0.1

MySQL sockets work fine with LSPHP 5.3.x and up. I've used LSWS for years and support 3rd party client whom run it and it's 2 cpu versions and such.

Read error logs.

Also if it said upgrade, make sure you have ALL MySQL packages installed

yum search all MySQL

install the dev packages the client the libraries whatever there is make sure you have it all. Then re-compile php with mysql, mysqli, socket option too. The php.ini one can be wonky webzian guy, as a web host since 15 years whom is developing an OS and Web Hosting panel in my spare time I think I know best. I get paid thousands by people for a few hours of my tuning/cluster setups. This is the end of my free help sadly the OP doesn't seem to know what doing.

Good luck soliving your issue, if 127.0.0.1 works then whats the issue, ditch the socket not every php application works good with mysql socket.
__________________
-William C.Manns Owner of XenServ Co
Need LiteSpeed Hosting, Server Tuning, or Other Help I'm your guy

http://xenserv.com http://evilpuma.com
Reply With Quote
  #9  
Old 10-21-2012, 09:31 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,339
Quote:
Originally Posted by pooyan View Post
I changed all php.ini value to mysql.default_socket = /var/lib/mysql/mysql.sock

But now after start lsws and test a website display this error:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
this is not lsws issue but mysql client is old. to work around this, add a line to your my.cnf (usually /etc/my.cnf)

Quote:
old_passwords=1
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:36 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.