How do I change the config path for mysqld?

Posted on

Question :

I want to change configuration file path from C: to E:, but I can’t find the way to do this.

Alternatively, is there a way to start a new instance with the config file I want? I’ve done something like mysqld --init-file="E:dbmy.ini" but it didn’t work as well.

–EDITED–

I started new instance with the config files, and it worked well, and I faced another problem. Could you give me a help for this one as well?

https://dba.stackexchange.com/questions/100492/cannot-change-datadir-for-mysqld

Answer :

You need to use the –defaults-file option as follows

mysqld --defaults-file="E:\db\my.ini"

or

mysqld --defaults-file="E:/db/my.ini"

If you are running MySQL 5.6 already on the Windows machine and you are trying to run an additional MySQL 5.6 instance, make sure you change the following under the [mysqld] group header in your my.ini

  • the port number (other than 3306)
  • datadir (such as E:db)

perhaps like

[mysqld]
port = 3307
datadir = "E:/db"

Give it a Try !!!

Leave a Reply

Your email address will not be published. Required fields are marked *