前几天安装mysql5.1, 自定义了安装路径E:\mysql, 但是数据库data目录却在

C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data ,C盘毕竟是系统盘,咱不能把数据库数据放到C盘,怎么修改该路径呢?

2、找到mysql安装目录下的配置文件my.ini, 找到这行

#Path to the database root

datadir="C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data\"

将以上默认的路径更改为:

#Path to the database root

datadir="E:\mysql\data\"

3、将原datadir="C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data"目录拷贝到E:\mysql目录下;

4、启动mysql服务;

用show variables like '%dir%';命令查看:

mysql修改data目录方法-LMLPHP

03-15 20:35