Monday, November 10, 2008

MySQL 5.0 install nightmare

Playing around with setting up my own sandbox SIM to kick the tires of Opensim this weekend. I decided it would be a good idea to do at least part of it using JeOS VM's. OpenSim requires a database of some flavor (it support SQLLite, MySQL and there is some support for MS SQL Server). Soooo I decided to at least set up a VM running Ubuntu's specialized JeOS 8.04 server and then toss MySQL from the repositories on there. Setting up Ubuntu server was easy enough. Setting up MySQL 5.0 from the repositories on the other hand proved painstaking.

On my first try, the MySQL config that launches after package install, bungled up. I suspect because I changed the networking from DHCP to static and then restarted the network (by running the /etc/init.d/networking script). However logically that doesn't make sense to me...
In any case the config failed on trying to start the mysqld daemon.
I rebooted and then restarted the install by running:
apt-get install mysql-server
This then configured the server (at least it presented me the config screen for root user account), stopped (although since is was a fresh install this step was superfluous) and started the mysqld daemon and this time is was Ok.
However I was still far from home as it turned out... When trying to run the MySQL admin tool from my Desktop, I kept getting the 2003 error (connection refused). At first I thought this was being caused by firewalls, however these were not enabled...
Then I found out that the /etc/mysql/my.cnf file had a staticbind to 127.0.0.1, thus the server only responded to requests from the localhost.
Changed it and also made sure that mysql root user was allowed to log on from all hosts by logging on local to mysql -u root -p and running:
GRANT ALL ON *.* TO 'root'@'%';

After that still no luck!! At this point I was ready to pull my hair out...
Its usually at these points that one start to doubt oneself as in still being of sane mind... Salvation finally came by accident. I removed the password I had set for root at installation time to put in another I had set at the MySQL server console and pressed the Enter key by accident. Low and behold it logged on!!
I was in with an empty password, despite having set a root password during the install configuration of mysql!!! In the end this problem may be isolated to the Ubuntu MySQL-server-5.0 packages, but who knows (I certainly am not going to waste more time finding out)...
So much time wasted due to such an incredible bug and non-sensible default settings... While I love the OpenSource world for all it is doing for computing and the wonderful tools it has produced. It is hard to find the right information about these sorts of bugs...

No comments: