Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running 5 instances of mysql (backup replication server), and I need to run mysql_upgrade on server id=3 (port 3303). When i try doing

# mysql_upgrade -P3303 

The script runs on the #0 (id=0) instance and not #3.

Anyone know how I can do this?

share|improve this question

Might be just a little thing, but I think you need a space after the -P and before the port number. Or is that just a transcription error?

To prevent connecting to the otherinstances, you could stop all of them except the one you want to work on.

If the instance won't even start, then I don't think most of the tools will work either. It must have something fairly major wrong to cause it not to even start. Presumably you have an older version of MySQL that it will work with (that you're upgrading from) - can you run an older instance that doesn't need the upgrade and repair all your tables before retrying the upgrade? Or even do a dump and load from the old version into the new (should be fine as far as replication goes) instead of doing an in-place upgrade.

You could also try running mysqlcheck manually rather than via mysql_upgrade.

share|improve this answer

You could specifiy the Socket:
I think you probably need to specify the socket file for the specific instance with the -S switch, but I have never done this before. For example:

mysql_upgrade -S /var/run/mysqld/mysqld.sock

Or, you need to tell it to use TCP:
If you don't use the socket and do use tcp, you need to specify tcp with -h (not localhost) or --protocol=tcp . From the Manual:

You can specify a port number for connections to a local server, too. However, as indicated previously, connections to localhost on Unix will use a socket file by default. You will need to force a TCP/IP connection as already described or any option that specifies a port number will be ignored.

share|improve this answer
I can't connect via sock since the instance wont even start up without upgrading first. – Ian Aug 27 '09 at 19:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.