HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMajor

How can I move a MySQL database to another drive?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
canmovedatabasemysqlanotherhowdrive

Problem

I'm using MySQL 5.5 on a local machine to analyze a large amount of government data. I've created a local database that resides on my default drive (Win7 C: drive). I'd like to store the data on my E: drive, a large eSATA external drive.

What steps should I take?

Solution


  • Shutdown mysql.



  • Move all the files in your current data directory to the new location (check out the location in step 3 - datadir parameter).



  • Locate my.ini file (it is in the mysql installation directory). Change datadir parameter value to point to the new location.



  • Start mysql.

Context

StackExchange Database Administrators Q#14320, answer score: 48

Revisions (0)

No revisions yet.