其实问题不大,就是win10永远有点奇葩的地方。
下载,解压,命名什么的我就不说了。
环境变量方便cmd使用mysql
MYSQL_HOME = xxx // 就是安装的路径
Path = %MYSQL_HOME%\bin // 安装路径下的bin
主要是出在my.ini上面,要自己创建。在%MYSQL_HOME%
下面新建一个文件my.ini
,作为MySQL启动的配置文件。
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/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]
# 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.
# port = .....
# server_id = .....
#设置服务器字符集为utf8
character_set_server=utf8
collation-server=utf8_general_ci
#设置mysql的安装目录
basedir = {修改成%MYSQL_HOME%}
#设置mysql的数据文件存放目录
datadir = {指定数据文件的存放路径}
#设置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 = {修改成%MYSQL_HOME%}\bin\mysqld.exe
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
问题是自动创建数据库的命令,我只找到这种在win10下是可以正确使用的
自动创建数据库 mysqld.exe --initialize-insecure --user=mysql
安装 mysqld.exe -install
服务启动 net start mysql
日志查询 mysqld --console