i have install mysql in my server {ubuntu 12.04 LTS} and it's work great
but now all my database is down and when i run in termeanl {mysql} it's give this error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
and when i try to start mysql it's give that error {service mysqld start}
mysqld: unrecognized service
i dont need to lose my data so i dont make anything in the server, can you please help me?
As i menthoid here, there are many ways to rome. I did mention apache, but as you figured out, the correct term was mysqld.
So instead of the command start mysql, you can also use /etc/init.d/mysqld start.
There are lots and lots of links for troubleshooting this error. For example:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
In your case "111" is connect error - you simply don't have the mySql server running.
So the real problem is getting "service mysqld start" to work.
Suggestion: try reinstalling:
https://serverfault.com/questions/361614/mysqld-unrecognized-service
http://www.linuxquestions.org/questions/linux-software-2/mysqld-unrecognized-service-4175432133/
Related
Every time I reboot my computer and try to access my mysql database it produces the following error:
ERROR 2002 (HY000):
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
any ideas on how to resolve this?
It might be that your MySQL is not started automatically on system start-up. Kindly execute mysqld to start the MySQL.
Or please refer https://askubuntu.com/questions/416309/start-mysql-on-startup, to start MySQL on system start-up, assuming that you are on Linux OS.
I have mysql database which was working fine earlier. After getting too many connections error. I have increased max connection and restarted my centos server. But after restart I used below command to connect to server.
mysql -uroot -p
But I am getting below errors.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2).
I tried all the options available on google. But it didn't worked for me. Some are saying to reinstall mysql, but I have data in GB's which I don't want to lost. Please can anyone help me to solve this problem.Thanks in advance.
Make sure you are indexing the right socket file.
Try this and provide the output.
check the socket in the my.cnf
cat /etc/my.cnf | grep -i socket
I have started mysql using
brew services start mysql
and I made sure that mysql is started by checking it using
brew services list
it shows that the status of mysql is "started".
however when I try to run the command
mysql
it'll say:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (62)
I have searched online for multiple answers already but none of them would solve my problem.
How should I solve this?
in my mac, run this will solve my problems
$ sudo mysql.server start
I'm trying to run a mysql connection, and I am getting this error:
ERROR: Unable to connect to mysql: (2002) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
I have been checking on other forums etc, and yes i checked if mysql server is running, and yes it is running ok,no portblocking, but what i see strage is that i dont ahve mysql.sock in my /var/lib/mysql directory.
I appreciate any sign of help.
I have tried all the solutions to access mysql that are described before in stackoverflow.
When I type mysql and the terminal asks for password,when I type password and press enter it says ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Any idea,this problem making me crazy.
Thanks in advance.
Make sure you're starting the mysql server first. The command is sudo mysqld_safe. Also try looking at my.cnf (likely in /etc/) and search for "socket". You may need to change the socket location to /tmp/mysql.sock.