更改默認的mysql數據庫目錄
將 C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data 改到 D:\MysqlData
1. 建立文件夾 D:\MysqlData
2. 停止 mysql 服務,將 "C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data" 所有文件,拷貝到 D:\MysqlData
3. 在 mysql 安裝目錄找到 my.ini文件,找到:
#Path to the database root
#datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"
將datadir的值改為: datadir="D:/MysqlData/"
保存后,重新啟動mySQL服務即可。