更改默认的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服务即可。

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2021-09-29
  • 2021-10-07
  • 2022-12-23
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2021-10-02
  • 2021-08-22
  • 2022-12-23
  • 2021-06-24
  • 2021-10-08
  • 2022-02-09
相关资源
相似解决方案