修改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 hub上有些鏡像的tag被標記““This image has vulnerabilities””2. Span標簽3. css - 求推薦適用于vue2的框架 像bootstrap這種類型的4. docker-machine添加一個已有的docker主機問題5. java - Collections類里的swap函數,源碼為什么要新定義一個final的List型變量l指向傳入的list?6. css - 關于div自適應問題,大家看圖吧,說不清7. android新手一枚,android使用httclient獲取服務器端數據失敗,但是用java工程運行就可以成功獲取。8. angular.js使用$resource服務把數據存入mongodb的問題。9. redis啟動有問題?10. SessionNotFoundException:會話ID為null。調用quit()后使用WebDriver嗎?(硒)
