修改my.cnf后mysql无法运行???
仅有的幸福
仅有的幸福 2017-06-06 09:51:57
0
1
572

下面是my.cnf的全部内容:

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

然后加入修改字符的两句话:

[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8

然后就不能运行了

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
仅有的幸福
仅有的幸福

全部回复(1)
某草草
  • 把新加入的两句话用#注释掉试一下,能不能启动(排除新引入配置出错)

  • 运行mysqld status查看Mysql当前启动状态(排除因未关闭导致无法启动)

  • 运行用户权限是否发生变化,如之前用root,现在用user(排除权限问题)

如果第一步就可以启动,则说明新配置有问题,根据响应Mysql版本查一下启动参数是不是写错,以上。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板