mysqldump:得到错误:2002:尝试连接时,“无法通过套接字'/run/mysqld/mysqld.sock'(2)连接到本地MySQL服务器”

时间:2019-12-13 15:13:06

标签: mysql mysql-error-2002

我正在尝试使用php wp-cli.phar db export导出wordpress数据库,但出现此错误

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

寻找答案后,我尝试使用sudo systemctl start mysql启动mysql.service,但未找到

Failed to start mysql.service: Unit mysql.service not found.

我还尝试使用sudo systemctl start mariadb启动mariadb.service,但是它不起作用

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

我找不到有关如何解决这些错误的答案,有人可以帮助我吗?

0 个答案:

没有答案