Board index Mysql General MYSQL ERRORS

ERROR 2002 (HY000): Can't connect to local MySQL server thro

Postby a24uall » Sun Nov 04, 2012 9:38 am

Getting the error "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)" while I try to connect to mysql via a jailed shell enabled user.

[email protected] [~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[email protected] [~]#


Solution :
You need to specify the hostname so you can connect.
mysql -h=127.0.0.1 -u user_name -p

or
mysql -h=localhost -u user_name -p
Arun
WebhostingDevelopment.com
a24uall
Site Admin
 
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

Re: ERROR 2002 (HY000): Can't connect to local MySQL server

Postby a24uall » Sun Nov 04, 2012 9:42 am

To run any mysql command and output that to a file use
mysql -h 127.0.0.1 -p -e "select search_string from user_database.table_name;" > myoutput.txt
a24uall
Site Admin
 
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am


Return to MYSQL ERRORS

Who is online

Users browsing this forum: No registered users and 1 guest


cron