ITPub博客

首页 > 数据库 > MySQL > mysqldump: Got error: 2002: Can't connect to local MySQL server through.....

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

原创 MySQL 作者:starive 时间:2014-10-15 15:51:30 0 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/26435490/viewspace-1299651/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: Cluster简介
请登录后发表评论 登录
全部评论

注册时间:2014-01-18

  • 博文量
    143
  • 访问量
    530075