MySQL Forums
Forum List  »  Newbie

Re: How can I move a MySQL database to another drive?
Posted by: Peter Brawley
Date: May 10, 2021 10:07AM

Datadir accepts just one literal argument. To get MySQL to work with multiple datadirs, you need to play games with symlinks. Not recommended, so the better solution is to move all DBs to the desired location.

And: using an external (or lan) drive is usually not a good idea---when the external or lan drive is unavailable, even for a moment, very bad things happen to your databases.

Method for moving everything ...

1 backup everything

2 shut down mysql

3 move all the files in current data directory to the new location

4 update my.ini with the new datadir value

5 start mysql.

Options: ReplyQuote


Subject
Written By
Posted
Re: How can I move a MySQL database to another drive?
May 10, 2021 10:07AM


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.