mysqldump: Got error: 2002: Can't connect to local MySQL server through.....

starive發表於2014-10-15

mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect


最近在學習邏輯備份--mysqldump。備份一般的資料庫沒有問題,但是備份所有的資料庫:

  1. mysqldump -uroot -p*** -all-database > /home/*****/mysql/backup/alldatabase.sql

備份系統資料庫information_schema.sql:

  1. mysqldump -uroot -p information_schema > /home/*****/mysql/backup/information_schema.sql


都會報同樣的錯誤,如下:

mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect


解決方法:


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26435490/viewspace-1299651/,如需轉載,請註明出處,否則將追究法律責任。

相關文章