因为项目要用到MySQL的5.6版本,于是下载了5.6.10,但是安装失败了,于是进行卸载操作后,又下载了MySQL5.6.17的免安装版。
1、下载免安装版之后,解压,找到解压文件下的my-default.ini文件,复制一份并改名为my.ini,对里面的配置文件进行更改,更改如下:
[WinMySQLAdmin]
Server=E:\Mydata\mysql-5.6.17\bin
[client]
no-beep
# pipe
# socket=mysql
port=3306
[mysql]
default-character-set=utf8
# 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]
explicit_defaults_for_timestamp = TRUE
# 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 = 1G
# 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 ="E:\Mydata\mysql-5.6.17"
datadir ="E:\Mydata\mydata"
port =3306
server_id = 1
general-log=0
general_log_file="mysql_general.log"
slow-query-log=1
slow_query_log_file="mysql_slow_query.log"
long_query_time=10
log-error="mysql_error_log.err"
default-storage-engine=INNODB
max_connections=1024
query_cache_size=128M
key_buffer_size=128M
innodb_flush_log_at_trx_commit=1
innodb_thread_concurrency=128
innodb_autoextend_increment=128M
tmp_table_size=128M
# 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
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
character-set-server=utf8
Server=E:\Mydata\mysql-5.6.17\bin
[client]
no-beep
# pipe
# socket=mysql
port=3306
[mysql]
default-character-set=utf8
# 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]
explicit_defaults_for_timestamp = TRUE
# 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 = 1G
# 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 ="E:\Mydata\mysql-5.6.17"
datadir ="E:\Mydata\mydata"
port =3306
server_id = 1
general-log=0
general_log_file="mysql_general.log"
slow-query-log=1
slow_query_log_file="mysql_slow_query.log"
long_query_time=10
log-error="mysql_error_log.err"
default-storage-engine=INNODB
max_connections=1024
query_cache_size=128M
key_buffer_size=128M
innodb_flush_log_at_trx_commit=1
innodb_thread_concurrency=128
innodb_autoextend_increment=128M
tmp_table_size=128M
# 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
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
character-set-server=utf8
2、此时需要进入dos命令行,启动MySQL服务
(1)进入文件安装目录
(2)使用mysqld install命令进行安装,若安装成功,则如下图所示
(3)此时,只是安装了MySQL,但是MySQL的服务仍然没有启动,需使用net start mysql命令来启动服务
若启动成功,则如下图所示
此时,MySQL已经安装成功。
我使用的MySQL操作工具为navicat,下载的为免安装版
操作界面如下