MySQL Forums
Forum List  »  Install & Repo

MySQL 5.7 - datadir change
Posted by: Diptin Patel
Date: December 16, 2015 04:26PM

Hello,

I'm trying to change the location of datadir to alternate location, but I keep getting an error.

I'm running mysql-community-server-5.7.10-1.el7.x86_64.rpm on RedHat 7.0

I've done following:

- copied data
cp -rap /var/lib/mysql /data/mysql
chown mysql.mysql /data/mysql

- updated my.cnf from
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

- to
datadir=/data/mysql
socket=/data/mysql/mysql.sock

-restarted service
service mysqld start

and getting following error:
Redirecting to /bin/systemctl start mysqld.service
Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details.

Log file doesn't get updated. When I revert everything, all is good.

I'm all lost. I need to move databases to different storage.

Please help! Thanks in advance.

Options: ReplyQuote


Subject
Written By
Posted
MySQL 5.7 - datadir change
December 16, 2015 04:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.