I have recently installed SQLDeveloper and connected to mysql through it, after which I am facing following error:
[root@tborl01 LATER]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@tborl01 LATER]#
while connection with same credential is successful through SQLDeveloper, this means that the mysqld is running.
I have closed the connection through SQLDeveloper and again tried to connect through command prompt but faces same error.
I have also tried to start/ restart mysql service:
service mysql restart
MySQL manager or server PID file could not be found! [FAILED]
Starting MySQL.................................................................................................../etc/init.d/mysql: line 159: kill: (21944) - No such process
[FAILED]
Listing running process gives following output( shows mysqld as running)
[root@tborl01 init.d]# ps -eaf | grep mysqld
root 4849 1 0 2011 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/tborl01.pid
mysql 4878 4849 0 2011 ? 02:39:06 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/tborl01.pid --skip-external-locking
root 19572 21368 0 13:42 pts/6 00:00:00 grep mysqld
Does SQLDeveloper changes some setting?
mysql is not the service it is mysqld
you need to connect with mysql as
mysql -h 127.0.0.1 -u root -p
Try and let me know