Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I move MySQL database files from drive C: to D: ? 1

Status
Not open for further replies.

SantaMufasa

Technical User
Jul 17, 2003
12,588
US
When we installed MySQL 5.0.45 (on Windows XP), we took the default installation directory specifications, which placed our MySQL instance's data files in:

C:\Program Files\MySQL\MySQL Server 5.0\data

Our C: drive is full. We have 140 GB of free space on D:. We would like to relocate our MySQL "...data" directory onto the D: drive.

We have been unsuccessful in locating in the documentation how to make this happen.

Can someone please either"

1) direct me to a link in the doc to accomplish this or
2) post the steps we must follows to successfully relocate the contents of our "...data" directory from C: to D:?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Just stop the server, move the files from the data directory to your chosen directory (for example d:/mysql-data), and edit the configuration file (it's called my.ini or my.cnf) to include the entry:[tt]
[mysqld]
datadir=d:/mysql-data[/tt]
Then restart the server.
 
And of course, make sure the new directory has the same permissions as the old one.
 
Tony,

Thanks for confirming the simplicity of achieving my objective in MySQL. Hava
star.gif
!

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top