修改my.cnf后mysql無法運行???
問題描述
下面是my.cnf的全部內(nèi)容:
## 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當前啟動狀態(tài)(排除因未關(guān)閉導致無法啟動)
運行用戶權(quán)限是否發(fā)生變化,如之前用root,現(xiàn)在用user(排除權(quán)限問題)
如果第一步就可以啟動,則說明新配置有問題,根據(jù)響應Mysql版本查一下啟動參數(shù)是不是寫錯,以上。
相關(guān)文章:
1. 在應用配置文件 app.php 中找不到’route_check_cache’配置項2. html按鍵開關(guān)如何提交我想需要的值到數(shù)據(jù)庫3. HTML 5輸入框只能輸入漢字、字母、數(shù)字、標點符號?正則如何寫?4. gvim - 誰有vim里CSS的Indent文件, 能縮進@media里面的5. 跟著課件一模一樣的操作使用tp6,出現(xiàn)了錯誤6. PHP類屬性聲明?7. 利用百度地圖API定位及附件商家信息服務8. javascript - 求助canvas繪制馬賽克的問題,老是取色不準9. java - 安卓接入微信登錄,onCreate不會執(zhí)行10. javascript - 請教如何獲取百度貼吧新增的兩個加密參數(shù)
