0

I would like to move everything that is related to my current MySQL database(s) into a subdirectory of /home/mysql. I don't need to move log files or my.cnf, only data.

I don't know where the actual database files are stored and how to tell MySQL to load them from a different directory after I move them.

Can you give me some guidance?

usr-local-ΕΨΗΕΛΩΝ
  • 2,359
  • 7
  • 34
  • 52

1 Answers1

1

The data directory is specified by the datadir variable. You can check to see what the current data directory is with a:

show variables like 'datadir';

In your my.cnf under the [mysqld] section you can set:

datadir=/path/to/mysql/data

Cheers

HTTP500
  • 4,833
  • 4
  • 23
  • 31