修改my.cnf后mysql無(wú)法運(yùn)行???
問(wèn)題描述
下面是my.cnf的全部?jī)?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
然后就不能運(yùn)行了
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ’/var/run/mysqld/mysqld.sock’ (2)
問(wèn)題解答
回答1:把新加入的兩句話用#注釋掉試一下,能不能啟動(dòng)(排除新引入配置出錯(cuò))
運(yùn)行mysqld status查看Mysql當(dāng)前啟動(dòng)狀態(tài)(排除因未關(guān)閉導(dǎo)致無(wú)法啟動(dòng))
運(yùn)行用戶權(quán)限是否發(fā)生變化,如之前用root,現(xiàn)在用user(排除權(quán)限問(wèn)題)
如果第一步就可以啟動(dòng),則說(shuō)明新配置有問(wèn)題,根據(jù)響應(yīng)Mysql版本查一下啟動(dòng)參數(shù)是不是寫(xiě)錯(cuò),以上。
相關(guān)文章:
1. mysql - 表名稱前綴到底有啥用?2. 致命錯(cuò)誤: Class ’appfacadeTest’ not found3. 老師們php,插入數(shù)據(jù)庫(kù)mysql,都是空的,要怎么解決4. 求大神支招,php怎么操作在一個(gè)html文件的<head>標(biāo)記內(nèi)添加內(nèi)容?5. php點(diǎn)贊一天一次怎么實(shí)現(xiàn)6. 怎么php怎么通過(guò)數(shù)組顯示sql查詢結(jié)果呢,查詢結(jié)果有多條,如圖。7. PHP類(lèi)屬性聲明?8. sql語(yǔ)句 - 如何在mysql中批量添加用戶?9. phpstady在win10上運(yùn)行10. 在應(yīng)用配置文件 app.php 中找不到’route_check_cache’配置項(xiàng)
