出現錯誤訊息
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/usr/local/mysql/mysql.sock' (2)
原因
通常是 mysql.sock 檔案路徑不對mysql.sock 通常會放在 /var/lib/mysql/mysql.sock
而剛安裝的 mysql (mariaDB) 通常 /etc/my.cnf 是空的內容
解法一:
/etc/my.cnf 加入這段即可[client] port = 3306 socket = /var/lib/mysql/mysql.sock
解法二:
可行,但不優$ ln -s /var/lib/mysql/mysql.sock /usr/local/mysql/mysql.sock
22
33
55bbb
66cccccc1111