Go Back   Data Center, Colocation, Cloud Computing, Storage, Dedicated Servers Forums > General DataCenter Discussion Forum > Data Center Prodcuts Reviews, Tools, Tips and Check List

Reply

 

Thread Tools
  #1  
Old 04-25-2011, 10:27 AM
emad emad is offline
Member
 
Join Date: Jan 2011
Posts: 61
Thumbs up Steps to Change Mysql Data Path

Hi All,

Follow the steps to Change mysql data path.

Before changing the data path folder stop the Mysql server.

Quote:
/etc/init.d/mysqld stop
Make a new directory for the data path

Quote:
mkdir /opt/mysql_data
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.

Quote:
/etc/init.d/mysqld start
Regards,
Emad
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:39 AM.

Member Area



Data Center Industry Daily News


Cloud and Dedicated Hosting


Sponsors Managed Servers Sponsored by DedicatedNOW.
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.