您的位置:首页 > 数据库 > MySQL

mysql-5.7.10-winx64免安装配置方法以及mysql服务无法启动 服务没有报告任何错误解决办法

2015-12-22 10:20 1476 查看

mysql-5.7.10-winx64免安装配置方法以及mysql服务无法启动 服务没有报告任何错误解决办法

四步走

解压mysql-5.7.10-winx64到D盘根目录下(随意)

进入mysql-5.7.10-winx64目录,拷贝my-default.ini文件为my.ini,打开里面的注释如下:

# 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]

# 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-5.7.10-winx64
datadir = D:\mysql-5.7.10-winx64\data
port = 3306
server_id = 10001

# 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 .在mysql-5.7.10-winx64目录下新建文件夹名为’data’

4 . 打开dos窗口进入mysql-5.7.10-winx64\bin目录输入如下命令(管理员模式管理员模式管理员模式)

// 这条命令如果不输,也能安装成功,但是启动的时候就会报错说:服务无法启动 服务没有报告任何错误解决办法
// 这条命令之前确保data文件夹内容为空
// 文档表明,使用-initialize生成随机密码,由于自己学习,使用-initialize-insecure生成空密码。默认帐号root,后面的-user=mysql不更改
mysqld --initialize-insecure --user=mysql
// 安装服务
mysqld install
// 启动服务
net start mysql
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql