MySQL Forums
Forum List  »  Install & Repo

Re: Moving a MySQL installation to another folder location...
Posted by: Keith Larson
Date: June 04, 2013 09:26PM

Is everything under the same directory ?

> SELECT @@datadir;
+-----------------+
| @@datadir |
+-----------------+
| /var/lib/mysql/ |
+-----------------+

Don't forget to update the related logs as well:

show variables like '%log%';
show variables like '%dir%';
show variables like '%file%';

Basically review show variables and update the my.cnf accordingly.

Shut down the database and update the my.cnf file with the new locations that you have moved everything into

ie: datadir = /var/lib/mysql_new/

Confirm permissions on the folder are same as the old folder had.
Start it up and should be using the new location.

If you have logs and etc split out then update those locations as well in my.cnf



The smart thing... would also to have a dump of all your data ahead of time as well as keep a copy of the original my.cnf file. Just in case bad things happen.

other examples of this-- http://ubuntuforums.org/showthread.php?t=804126

Just trying to help....

http://anothermysqldba.blogspot.com

Options: ReplyQuote


Subject
Written By
Posted
Re: Moving a MySQL installation to another folder location...
June 04, 2013 09: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.