Hi All,
Follow the steps to Change mysql data path.
Before changing the data path folder stop the Mysql server.
Make a new directory for the data path
Now we need to copy the existing database in to the new location /opt/mysql_data
Quote:
cp -R /var/lib/mysql /opt/mysql_data
|
After copying the database we need to update the new data path file in the my.cnf file.
Quote:
vi /etc/my.cnf
datadir = /var/lib/mysql
Change it to
datadir = /opt/mysql_data
|
Now we moved the mysql data directory in to the new location and start the Mysql server to write the DB files to the new location.
Regards,
Emad