在mysql的根目录下新建一个my.ini
[mysqld]
character-set-server=utf8
#绑定IPv4和3306端口
bind-address = 0.0.0.0
port = 3306
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
default_storage_engine=innodb
innodb_buffer_pool_size=1000M
innodb_log_file_size=50M
# 设置mysql的安装目录
# basedir=F:/test/mysql-5.7.19-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\mysql-5.7.27-winx64\data
# 允许最大连接数
max_connections=200
# skip_grant_tables
[mysql]
default-character-set=utf8
[mysql.server]
default-character-set=utf8
[mysql_safe]
default-character-set=utf8
[client]
port = 3306
plugin-dir=D:\mysql-5.7.27-winx64\lib\plugin
//然后重启服务器,注意需要以管理员的身份 net stop/start mysql