my.ini(放在根目录下,及默认位置,而不是拷到bin下)配置为如下:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
basedir = D:\MySql\mysql-5.7.17-winx64\bin
datadir = D:\MySql\mysql-5.7.17-winx64\data
port = 3306
explicit_defaults_for_timestamp=true
character_set_server = utf8
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[client]
port = 3306
default_character_set = utf8
[mysql]
default_character_set = utf8
重启Mysql