2011-03-25

I'm trying to set up multiple MySQL database instances on a single server and I'm getting some very weird results. I can get the different instances up and running, listening on different ports, using different .cnf files, using different datadirs, etc. As far as I can tell, I've got two separate, independent instances. Below is a copy of when I run "ps aux | grep mysql".

Now is where it gets weird. When I log into the db's remotely with Navicat, I can edit the contents of the databases, no problem. However, when I run a script to access the data on the different dbs, I get a a table doesn't exist error because the script is trying to access the first instance running on port 3306, even though I specify port 3307 for my second connection resource.

Another thing I noticed is that if I SSH into the server housing the two DB instances and log in to one of them using mysql -u root --port=3306 -p and do something like change the password for the root user, the root password has changed when I try to connect using mysql -u root --port=3307 -p;

I've been working on this for a few days now and I'm completely stumped. I'm working with Fedora 8 on an Amazon AWS server. Any help would be most appreciated!

Here's the contents of my.cnf:

And here's the contents of my2.cnf:

Show more