[root@DB ~]# /usr/local/mysql/bin/mysqld --verbose --help |grep -A 1 'Default options' Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf #服务器首先会读取/etc/my.cnf文件,如果
1:停止mysql服务 2:找到配置文件路径 C:\ProgramData\MySQL\MySQL Server 5.6\my.ini 3:修改属性datadir 1.将C:/ProgramData/MySQL/MySQL Server 5.6/Data改为C:/mysql/data (C:/mysql/data这个文件夹要预先创建) 2.拷贝C:/ProgramData/MySQL/MySQL Server 5.6/Data中所有文件到C:/mysql/data 4:重启mysql服务 5:可