Saturday, November 12, 2005

Finally managed to get RadRails working on Ubuntu 5.04

I finally managed to get RadRails working on my Linux machine. The reason I was having problem connecting to MySQL database was because I didn't turn on networking for MySQL. Yes, I am an idiot but it wasn't obvious that MySQL is skipping networking. It was only using socket and not TCP/IP.

I forgot the reason why I was doing netstat -a on the machine. But while looking through the list I didn't see any process listening on port 3306. That was odd since I was expecting MySQL to be listening to that port. I took a look at /etc/mysql/my.cnf and sure enough port=3306 is there. So, the next obvious step was googling to see why that is the case. I found this post which talk about skip_networking option in my.cnf. I look at my own my.cnf and skip_networking was enabled. I commented it out and restarted MySQL. I could see a process listening on port 3306 after doing a netstat -a. I tried to telnet to the port but got this error, "localhost.localdomain' is not allowed to connect to this MySQL server Connection closed by foreign host".

So, I added localhost.localdomain to the list of allowed hosts in MySQL and I was able to telnet to port 3306. I fired up RadRails and attempted to start the server. I still get the database connection error but now there is an error message about todo@localhost.localdomain is not allow. I went ahead and added the user to the database and now everything is working. I can finally use RadRails to start developing the Todo tutorial. I probably has the least secure MySQL server in the world but it is behind the firewall so it shouldn't be a problem.

Also, RadRails 0.4.1 is out. I can't wait until I have some free time to spend playing around with Ruby on Rails.

No comments: