zoukankan      html  css  js  c++  java
  • mysqldump导出报错问题

    在执行mysqldump命令时候报如下错误:
    [root@localhost ~]#  mysqldump -uroot -p -d test> test.sql   
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect

    找到正确的套接字的路径: 
    [root@localhost ~]#  netstat -ln | grep mysql                                   
    unix  2      [ ACC ]     STREAM     LISTENING     70442911 /MysqlData/base/mysql/mysql.sock


    再运行dump命令:
    [root@localhost ~]# mysqldump --sock=/MysqlData/base/mysql/mysql.sock -uroot -p -d test> test.sql   
    Warning: Using unique option prefix sock instead of socket is deprecated and will be removed in a future release. Please use the full name instead.

    Enter password: 

    执行成功,但有警告信息,提示使用sock前辍将在后继版本中可能不再支持,请使用全名

    将--sock 换成--socket将不再有问题:


    [root@localhost ~]# mysqldump --socket=/MysqlData/base/mysql/mysql.sock -uroot -p -d test> test.sql 

  • 相关阅读:
    UVa 541 Error Correction
    UVa 11045 My T-shirt suits me
    【模板】Ford-Fulkerson算法
    POJ 1273 Drainage Ditches
    UVa 10158 War
    UVa 658 It's not a Bug, it's a Feature!
    【模板】并查集
    【模板】Floyd-Warshall算法
    UVa 10034 Freckles
    UVa 10048 Audiophobia
  • 原文地址:https://www.cnblogs.com/wx90/p/7600609.html
Copyright © 2011-2022 走看看