can't move mysql datadir

Started by gilbert.jr, March 19, 2017, 12:49:06 PM

Previous topic - Next topic

gilbert.jr

somebody can help me ?
how to move data dir mysql on CWP Centos7 ?
i was try follow tutorial on CWP wiki about "How to change MySQL Location" but fail always return Restarting mysqld (via systemctl):  Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

please somebody help.

tackleza

Same as me! :'(

I spend more than 5 hours, do random things to make this work but it didn't
I want to make this work on Centos 7. For now I have to fallback to Centos 6 because of this

If anyone found solution for this please reply in this topic, thanks

Administrator

this works fine did that multiple times, make sure mysql is down when you do this things and check the logs if you have some errors!

locvfx

service mysqld stop
cd /var/lib
mv mysql YOUR_NEW_LOCATION_PATH
ln -s YOUR_NEW_LOCATION_PATH mysql
chown -R mysql:mysql YOUR_NEW_LOCATION_PATH
service mysqld start

luciferxe

I have tried but I get errors saying to check my password in the config files.
The password is the same one it generated on install.
This is on a fresh install as well.
Is there something I am missing?
Quote from: locvfx on May 01, 2017, 04:49:01 PM
service mysqld stop
cd /var/lib
mv mysql YOUR_NEW_LOCATION_PATH
ln -s YOUR_NEW_LOCATION_PATH mysql
chown -R mysql:mysql YOUR_NEW_LOCATION_PATH
service mysqld start
is