红联Linux门户
Linux帮助

my.ini配置文件引起的"无法启动mysql服务,发生错误1067"

发布时间:2016-07-15 15:03:06来源:linux网站作者:zhuxiongxian
1.问题描述
本人的mysql是官网下载的zip包绿色版5.7.4-m14版本,我从将mysql整个目录打包拷贝到另一个机器上,重新配置了my.ini及安装了mysql服务,但在启动mysql服务过程中出现“无法启动mysql服务,发生错误1067”,问题解决前的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 = .....
# datadir = .....
# port = .....
# server_id = .....
#mysql所在目录
basedir = E:\software\mysql
#mysql数据文件目录
datadir = E:\software\mysql\data
#设置默认的字符编码
#character_set_client=utf8
#character_set_connection=utf8
#character_set_database=utf8
#character_set_result=utf8
#character_set_system=utf8
character_set_server=utf8
init_connect='SET NAMES utf8'
# 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 
[client]
default-character-set=utf8
 
2.解决方法
经过一番折腾发现,windows的路径分隔符是\会常常给我们带来不必要的烦恼,只需要将路径分隔符\替换为/即可解决上述问题。如下:
# 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 = .....
# datadir = .....
# port = .....
# server_id = .....
#mysql所在目录
basedir = E:/software/mysql
#mysql数据文件目录
datadir = E:/software/mysql/data
#设置默认的字符编码
#character_set_client=utf8
#character_set_connection=utf8
#character_set_database=utf8
#character_set_result=utf8
#character_set_system=utf8
character_set_server=utf8
init_connect='SET NAMES utf8'
# 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 
[client]
default-character-set=utf8
修改完后重新启动mysql服务成功!
 
本文永久更新地址:http://www.linuxdiyf.com/linux/22394.html