Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have a HP-UX server with two instances of Mysql.

  1. The first one was the original and was located in /mysql, and keeps its database files in /mysql/data/

  2. The second one I have installed by mistake and is located in /usr/local/mysql, and it keeps its database files in /usr/local/mysql/data/

Now the problem is (i guess because of the new installation), when i issue the command to start the mysql daemon (the original one located in /mysql) i receive the following message:

enter image description here

... so as you can see I start the daemon from the old instance of mysql but when it starts it is now using the new installation database files.

How can i change the path (what file i should edit) in order to make the daemon to point to the old database files that are located in /mysql/data/?

share|improve this question
Did you try to change datadir directive on mysql config – Yasith Tharindu Jan 18 '12 at 18:18
up vote 2 down vote accepted

this should answer your question. it describes how mysql reads configuration files. It looks like you will need two users for mysql to run two instances from two different locations.

share|improve this answer
thanks for the link.. there is some great explanations there.. I'll see what I can do tomorrow and will post some feedback :) – Spirit Jan 19 '12 at 19:37

You can pass an option to mysqld here is the link

so, just start mysqd-safe script with --datadir=your_path option :

    #/mysql/bin/mysqld-safe --datadir=/mysql/data
share|improve this answer
hmmm.. i didn't know that.. I will try this as soon as I get back to work tomorrow :) – Spirit Jan 19 '12 at 19:35
Yup.. that did it :). By using the --datadir flag I was able to verify and force the daemon to use the database files located in /mysql/data folder. However by using the info link provided by @Chris Drappier I was able to correctly solve my problem. – Spirit Jan 20 '12 at 18:42

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.