5.5己正常的情况下,用官 方下载的安装包总是不成功,用的官方解压版
1.复制my-default.ini到my.ini,其中代码如下:网上看到的代码总是不同,注意data-dir和base-dir的杠必须是斜杠。之前忘记了一直用反斜杠也不知道,事件查看器看不到什么,在bin下运行mysqld可以看到你服务无法启动的原因,后来才想起来是反斜杠的问题,改好了后就可以了,base-dir与data-dir如果没有设,就是一直卡在那,但下面只设了data-dir,也可以打开。
# 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.
#basedir = F:/software/database/mysql_5.6.24_winx64/mysql-5.6.24-winx64
datadir = F:/software/database/mysql_5.6.24_winx64/mysql-5.6.24-winx64/data
port = 3307
# server_id = .....
# 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
3.几条指令:
mysqld --install mysql56 #此处不要再叫mysql,会和5.5冲突
如果出错,删除原先的服务sc delete mysql56,然后再改ini再install,直至成功。