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=
RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536
ARASHz4
  • 121
  • 1
  • 1
  • 6

1 Answers1

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 .

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536