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
inmy.ini
- For Mac, mysqld does not have parameter for
--defaults-file=
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 .
mysqld --help --verbose > mysqld.txt
. Look inside mysqld.txt. Do you see --install
as a parameter option ?
Commented
May 12, 2015 at 14:57
/etc/my.cnf
file and restart MySQL.