修改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/
然后加入修改字符的兩句話(huà):
[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:把新加入的兩句話(huà)用#注釋掉試一下,能不能啟動(dòng)(排除新引入配置出錯(cuò))
運(yùn)行mysqld status查看Mysql當(dāng)前啟動(dòng)狀態(tài)(排除因未關(guān)閉導(dǎo)致無(wú)法啟動(dòng))
運(yùn)行用戶(hù)權(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. docker鏡像push報(bào)錯(cuò)2. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””3. 關(guān)于docker下的nginx壓力測(cè)試4. docker - 如何修改運(yùn)行中容器的配置5. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問(wèn)題6. angular.js - angularjs的自定義過(guò)濾器如何給文字加顏色?7. 前端 - @media query 使用出現(xiàn)的問(wèn)題?8. html - css氣泡,實(shí)現(xiàn)“倒三角(不知道算不算三角了)”可透明的。9. html5和Flash對(duì)抗是什么情況?10. java - 如何點(diǎn)擊按鈕,重新運(yùn)行(我是初學(xué)者)?

網(wǎng)公網(wǎng)安備