Arvin
Arvin

Reputation: 1506

MySql change data path of each database

Is it possible to change the location/path/directory/folder of a specific database? I hope the answer is not "no".

I know that there is a "datadir" setting in

"X:\Program Files\MySQL\MySQL Server x.x\my.ini" 

file in which I can change the path for all databases. However, I want some specific databases to be specific location.

Example, I want “sales” database to be in “C:\sales\db\” folder and “hr” database to be in “C:\hr\db” folder. (Please don’t suggest of placing them in “C:\db\sales” and “C:\db\hr” folder respectively).

If it helps: I’m running MySql 5.1 under Windows XP SP3. I’m used to MS SQL Server’s ability to place database files on (restore to or attach from) user-specify location. I’m new to MySql. Thanx in advance.

Upvotes: 2

Views: 2759

Answers (1)

Ricardo Uzcategui
Ricardo Uzcategui

Reputation: 36

I found this answer using symbolic link... Maybe this help to you..

http://dev.mysql.com/doc/refman/5.0/en/symbolic-links.html

Upvotes: 2

Related Questions