How to change MYSQL database directory to another directory
Hi,
I Installed mysql on my CentOS 6.2 Server. But when I tried to change the location of /var/lib/mysql to another directory. I can't start the mysql. Below is what I've done
Code:
yum install mysql mysql-server mysql-devel
mkdir /path/to/new/
cp -R /var/lib/mysql /path/to/new
chown -R mysql.mysql /path/to/new
vi /etc/my.cnf
change datadir=/var/lib/mysql to
datadir=/path/to/new
Code:
service mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
Did I miss something? Can anyone please help me on this, I'm a newbie in this field.
Thank you
Jay