今天使用時出現

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

其實是忘記密碼啦XDD

#背景執行mysql安全模式
mysqld_safe -u root --skip-grant-tables  &

#登入mysql(不用密碼)
mysql -u root -p
>use mysql
>UPDATE user SET password=password('這裡輸入你的密碼') where user='root';
>FLUSH PRIVILEGES;
>exit
# 重開
/usr/local/etc/rc.d/mysql-server restart
Categories: FreeBSDMySQL

3 Comments

EQ · 24 3 月, 2010 at 5:48 上午

叫我神之手
哈哈哈

johnson · 24 3 月, 2010 at 9:28 上午

= =

cant connect to local mysql server through socket tmpmysqlsock -部落格熱搜- cant connect to local mysql server through socket tmpmysqlsock · 28 8 月, 2012 at 2:54 上午

[…] 佛祖球球» Blog Archive » [FreeBSD]MySQL無法開啟 […]

Comments are closed.