471,831 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,831 software developers and data experts.

Can't connect to local MySQL server through socket on Ubuntu.

129 100+
Hi friends,
I installed mysql in ubuntu but, i don't know how to connect to that mysql. Actually we connect to postgresql by psql command, but when i tried to connect mysql with mysql command but it displaying this error:

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

when i give mysql databasename it displaying the following error:

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

So friends, what is the solution for this problem?
Sep 27 '08 #1
1 8572
5,058 Expert 4TB

I would guess that your MySQL service is stopped. It needs to be started before you can start using it.

On Ubuntu, this command should start it up:
Expand|Select|Wrap|Line Numbers
  1. sudo /etc/init.d/mysql start
Please try to give your threads descriptive titles, so that they can be found by others with similar problems and so the experts can quickly find threads they can help with.

If your having trouble doing that, try using phrases you would be likely to use when searching for an answer in a search engine, like Google.
You should also check out the Posting Guidelines for more tips on how to construct a good thread title.

Thank you.
Sep 27 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Bill Hernandez | last post: by
2 posts views Thread by xiuchuanli | last post: by
5 posts views Thread by scorpionbilli | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.