我们的mysql文件中没有默认的配置文件,我们新建一个.ini的配置文件,名字为my-default.ini,里边内容如下:
# For advice on how to change settings please see
# *** 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]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = D:\mysql-server
# datadir = D:\mysql-server\data
# port = .....
# server_id = .....
#设置服务器字符集为utf8
character_set_server=utf8
collation-server=utf8_general_ci
#设置mysql的安装目录
basedir = D:\mysql-server
#设置mysql的数据文件存放目录
datadir = D:\mysql-server\data
#设置mysql服务所绑定的端口port = 3306
#设置mysql允许的最大连接数max_connections=15
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
[client]
#设置客户端字符集
default-character-set=utf8
[WinMySQLadmin]
Server = D:\mysql-server\bin\mysqld.exe
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
注意里面的几个路径,一定要修改为你的mysql文件夹所在的路径,由于我放的目录是D:\mysql-server,所以上面的配置路径都为这个。