简体   繁体   中英

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM