Wishlist 0 ¥0.00

mysql更改数据文件目录及my.ini位置

步骤:

1、查找my.ini位置,可通过windows服务所对应mysql启动项,查看其对应属性->可执行文件路径,获取my.ini路径。

  "D:\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="D:\MySQL Data\my.ini" MySQL55

2、编辑my.ini中对应datadir

  改前:datadir="D:\MySQL Data\data\"

  改后:datadir="D:\MySQL Data\MySQL Server 5.5\data\"

3、重整mysql对应数据文件目录(若不做,则mysql无法正常启动)

4、查找注册表,修改mysql启动项所关联的defaults-file路径:

  KEY_LOCAL_MACHINE/SYSTEM/Services/MySQL55

  修改完后,刷新windows服务,再次查看mysql启动项属性->可执行文件路径,结果如下:

  "D:\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="D:\MySQL Data\MySQL Server 5.5\my.ini" MySQL

  确保将my.ini移植到正确的目录下。

5、重启mysql,配置成功。

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.