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:
mysql -u root -pPassw0rd
Then it works.
Some usefull statements:
-- Create new account in MySQL: