dbTalk Databases Forums  

can connect to sql server through php but not with mysql cli client

comp.databases.mysql comp.databases.mysql


Discuss can connect to sql server through php but not with mysql cli client in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
yawnmoth
 
Posts: n/a

Default can connect to sql server through php but not with mysql cli client - 12-19-2010 , 10:47 AM






I'm able to connect to a MySQL database through PHP but not through
the mysql command. When I try I get the following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)

Any ideas?

I don't know if it matters but the MySQL server isn't installed
locally - traffic sent to 127.0.0.1:3333 is SSH port forwarded to an
SSH server which has the MySQL server installed on it.

Reply With Quote
  #2  
Old   
Sherm Pendley
 
Posts: n/a

Default Re: can connect to sql server through php but not with mysql cli client - 12-19-2010 , 01:31 PM






yawnmoth <terra1024 (AT) yahoo (DOT) com> writes:

Quote:
I'm able to connect to a MySQL database through PHP but not through
the mysql command. When I try I get the following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)

Any ideas?

I don't know if it matters but the MySQL server isn't installed
locally - traffic sent to 127.0.0.1:3333 is SSH port forwarded
It matters - when you connect to "localhost", the MySQL client lib
connects to a local domain socket (that's the /tmp/mysql.sock in the
error above) instead of resolving the host name to 127.0.0.1.

To connect through your tunnel, you must specify the IP address in your
connection string, not "localhost."

sherm--

--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer

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

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.