MySql Service 安装流程,包含解决服务无法启动 服务没有报告任何错误
2016-05-14 23:15
846 查看
今天在自己电脑上下载了mysql的压缩包,不是安装版的,而是压缩版的,我的版本是mysql-5.7.12-winx64.zip。
下载下来后,直接解压即可。
然后修改文件my-default.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]
port = 3306
basedir=F:\tools\MysqlService\mysql
datadir=F:\tools\MysqlService\mysql\data
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
max_connections=100
character-set-server=utf8
# 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:\tools\MysqlService\mysql
#datadir = F:\tools\MysqlService\mysql\data
# port = .....
# 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
[mysql]
default-character-set=utf8主要还是配置basedir和datadir两个配置。(网上说可以自己配置my.ini,但是我配置后报错,没有找到错误原因,所以直接在default中改了)。
改完后,以管理员身份打开cmd.exe命令提示符(快捷键win+x,然后ctrl+a即可)。
cd 到你的解压目录,比如我的是在 F:\tools\MysqlService\mysql 下,那么需要cd 到这个目录的bin下边。
然后运行 mysqld -install ,成功后执行mysqld --initialize-insecure 会初始化你的data文件夹内的内容(这个命令就是能解决按照百度经验中的方式安装却启动不了命令的错误的解决办法,具体的说明地址:http://bbs.csdn.net/topics/391851148?page=2 。68楼写的是正确的命令,前边说明了这么做的原因。)
最后运行net start mysql,服务启动成功!!!
下载下来后,直接解压即可。
然后修改文件my-default.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]
port = 3306
basedir=F:\tools\MysqlService\mysql
datadir=F:\tools\MysqlService\mysql\data
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
max_connections=100
character-set-server=utf8
# 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:\tools\MysqlService\mysql
#datadir = F:\tools\MysqlService\mysql\data
# port = .....
# 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
[mysql]
default-character-set=utf8主要还是配置basedir和datadir两个配置。(网上说可以自己配置my.ini,但是我配置后报错,没有找到错误原因,所以直接在default中改了)。
改完后,以管理员身份打开cmd.exe命令提示符(快捷键win+x,然后ctrl+a即可)。
cd 到你的解压目录,比如我的是在 F:\tools\MysqlService\mysql 下,那么需要cd 到这个目录的bin下边。
然后运行 mysqld -install ,成功后执行mysqld --initialize-insecure 会初始化你的data文件夹内的内容(这个命令就是能解决按照百度经验中的方式安装却启动不了命令的错误的解决办法,具体的说明地址:http://bbs.csdn.net/topics/391851148?page=2 。68楼写的是正确的命令,前边说明了这么做的原因。)
最后运行net start mysql,服务启动成功!!!
相关文章推荐
- mysql数据库处理乱码
- Mysql存储引擎
- Oneproxy 读写分离
- 一条SQL搞挂mysql案例一则
- MySQL更新用户密码
- MYSQL 3534错误
- mysql启动正常但是访问时还是报错: ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061
- Mysql——锁问题
- MySQL存储过程+游标+触发器
- MySQL服务启动提示window无法启动MySQL服务 错误1067:进程意外终止
- mac安装mysql
- mysql5.7安装和配置
- SQL的存储过程的理解与应用(以mysql为例)
- MapServer 之 使用 MySQL 数据
- 淘宝物流mysql slave数据丢失详细原因
- MySQL的source命令不加分号和delimiter的使用
- MySQL学习笔记--视图的创建,删除,修改,算法
- MySQL SQL优化
- heartbeat v3版之mysql
- MySQL学习13:操作数据表中的记录(一)