mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
最近在学习逻辑备份--mysqldump。备份一般的数据库没有问题,但是备份所有的数据库:
- mysqldump -uroot -p*** -all-database > /home/*****/mysql/backup/alldatabase.sql
备份系统数据库information_schema.sql:
- 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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26435490/viewspace-1299651/
本文解决使用mysqldump备份MySQL数据库时遇到的无法连接本地MySQL服务器的问题,通过设置socket路径成功备份所有数据库及系统数据库information_schema。

1784

被折叠的 条评论
为什么被折叠?



