HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

How do I change the config path for mysqld?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
paththemysqldconfigforhowchange

Problem

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:\db\my.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

Solution

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 !!!

Code Snippets

mysqld --defaults-file="E:\\db\\my.ini"
mysqld --defaults-file="E:/db/my.ini"
[mysqld]
port = 3307
datadir = "E:/db"

Context

StackExchange Database Administrators Q#100478, answer score: 4

Revisions (0)

No revisions yet.