2

How do I change the MySQL data folder path in a Mac?

  • I am running OS X 10.10 & MySQL 5.6
  • In Windows I can edit datadir in my.ini
  • For Mac, mysqld does not have parameter for --defaults-file=
2

1 Answer 1

2

First shutdown mysql

mysqladmin -uroot -p shutdown

Then, launch mysqld by hand

mysqld --defaults-file=...

or if MySQL is running with all defaults and you are just changing datadir, do this

mysqld --datadir=/path/to/mysql/data

Here is a StackOverflow question (MySQL 'my.cnf' location?) with multiple suggestions on where my.cnf might be for Mac OS when installed .

3
  • Thanks how can install a Service in mac like in windows mysqld --install myService --defaults-file=my.ini
    – ARASHz4
    Commented May 12, 2015 at 14:13
  • Go to command line, and run mysqld --help --verbose > mysqld.txt. Look inside mysqld.txt. Do you see --install as a parameter option ? Commented May 12, 2015 at 14:57
  • no i do not see --install i think this command is just for windows
    – ARASHz4
    Commented May 13, 2015 at 4:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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