0

I moved mysql datadir to /storage-s01/mysql, but socket is still located at the same directory /var/lib/mysql/mysql.sock. Do I have to keep socket at the same directory as datadir?

BTW, If I want to change datadir, i have to change that only /etc/my.cnf file?

I have mariadb

Kin Shah
  • 62,545
  • 6
  • 124
  • 245

2 Answers2

0

my.cnf should suffice for moving datadir. You will need a restart.

If my.cnf mentions mysql.sock, then be sure to change that, too. If it does not, then it will be assumed to be in your new datadir.

Rick James
  • 80,479
  • 5
  • 52
  • 119
0

You can't change Data directory dynamically. Only option is you have to change in configuration file and bounce the database.

s_ramesh
  • 59
  • 8