How to solve – Can’t connect to MySQL server on ‘localhost

Yesterday I started developing a site using Ruby On Rails with MySQL database.

When I tried to connect to MySQL I got error message

The funny part is that I was able to connect to mysql by using its command line client:

Solution:

Instead of trying to connect to localhost, connect to 127.0.0.1.

In case of Rails, do the following:

open the file

and edit the lines

so that they will look like

Save the file and you’re done.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Please, try my games, play free on-line games on my site, tweet this post url and share it on facebook, google+ and other social medias.

This entry was posted in development, other and tagged , , , . Bookmark the permalink.