如何将数据转移到数据盘?
转移网站数据
默认情况下 C:\websoft9\phpStudy\PHPTutorial\WWW 是在系统盘的,当需要转移到数据盘,步骤如下:- 停止 Apache 服务
- 将 C:\websoft9\phpStudy\PHPTutorial\WWW 下所有文件拷贝新的目录,假如为:D:\wwwroot
- 修改 C:\websoft9\phpStudy\PHPTutorial\Apache\conf\extra\httpd-vhosts.conf 文件, 将“C:\websoft9\phpStudy\PHPTutorial\WWW”修改为“D:\wwwroot”
- 重启Apache后生效
转移数据库文件
- 停止MySQL服务
- 将 C:\websoft9\phpStudy\PHPTutorial\MySQL\data 下所有文件拷贝到新目录,例如:D:\data
- 修改 C:\websoft9\phpStudy\PHPTutorial\MySQL\my.ini 文件,将以下语句
修改为:datadir="C:\websoft9\phpStudy\PHPTutorial\MySQL\data" log-error="C:\websoft9\phpStudy\PHPTutorial\MySQL\data\mysqld.log"
datadir="D:\data" log-error="D:\data\mysqld.log"
- 重启MySQL服务