修改my.cnf后mysql无法运行???
问题描述
下面是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版本查一下启动参数是不是写错,以上。
相关文章:
1. docker-machine添加一个已有的docker主机问题2. java-ee - JAVA的注解@Api和@ApiOperation的作用是什么,怎么跳转页面的3. java - mybatis会自己缓存自己生成过的prestatement吗4. java - 原生CGLib内部方法互相调用时可以代理,但基于CGLib的Spring AOP却代理失效,为什么?5. java - tomcat服务经常晚上会挂,求解?6. node.js - node express 中ajax post请求参数接收不到?7. apache - nginx 日志删除后 重新建一个文件 就打不了日志了8. 怎么能做出标签切换页的效果,(文字内容随动)9. mysql - mongo如何对一个collection进行顺序上的调整呢?10. chrome浏览器怎么使用
