Yesterday I started developing a site using Ruby On Rails with MySQL database.
When I tried to connect to MySQL I got error message
|
1 |
Can't connect to MySQL server on 'localhost' (10061) |
The funny part is that I was able to connect to mysql by using its command line client:
|
1 |
mysql -u root -p <ENTER> |
Solution:
Instead of trying to connect to localhost, connect to 127.0.0.1.
In case of Rails, do the following:
open the file
|
1 |
config\database.yml |
and edit the lines
|
1 |
host: localhost |
so that they will look like
|
1 |
host: 127.0.0.1 |
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.

