When using MySql with Rails, it runs properly when Rails and MySql are on the same computer, but running Rails from another computer which connects the MySql remotely get conection problem. Here is the solution.
- Modify the “/etc/mysql/my.cnf” file by commenting the content:
Then restart the MySql service by executing “service mysql stop; service mysql start”.
- Still cannot connection the MySql server, error message is “host ‘xxx’ is not allowed to connect to this MySQL server”, login the MySql server from the server it is and run the following command:
Then it works.
Some usefull statements:
1 2 3 4 5 6 7