AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-989920

Billy Istiak's questions

Martin Hope
Billy Istiak
Asked: 2022-10-26 06:44:48 +0800 CST

套接字不存在;无法通过套接字 '/var/run/mysqld/mysqld.sock' 连接到本地 MySQL 服务器 (2)

  • 5

我知道这个问题并不新鲜。但是我尝试了很多东西。我想不通的是,自从我下载了 mysql 后,socket 不可用。

/etc/my.cnf
/etc/mysql/my.cnf
/var/lib/mysql/my.cnf

以上文件均不可用。我一开始下载了mysql-server。由于它不起作用,我下载了 MariaDB。还是行不通。我可以用 MySql 做的是enable, restart(但不能启动)和version check. 我找不到其他我能做的事情。

尝试了以下所有链接等等。1、2、3 _ _ _ _

$-mysql -u root -p -h 127.0.0.1
Enter password: 
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)

如果我执行,我会收到以下消息systemctl status mysql。

mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2022-10-25 20:28:52 +06; 12min ago
    Process: 23398 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
        CPU: 4ms

অক্টোবর 25 20:28:52 istiak-PASSION-BX-PRO systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
অক্টোবর 25 20:28:52 istiak-PASSION-BX-PRO systemd[1]: Stopped MySQL Community Server.
অক্টোবর 25 20:28:52 istiak-PASSION-BX-PRO systemd[1]: mysql.service: Start request repeated too quickly.
অক্টোবর 25 20:28:52 istiak-PASSION-BX-PRO systemd[1]: mysql.service: Failed with result 'exit-code'.
অক্টোবর 25 20:28:52 istiak-PASSION-BX-PRO systemd[1]: Failed to start MySQL Community Server.

我尝试重新安装mysql-server仍然是同样的问题。仅供参考,我也用lampp-server安装了它们,但我也找不到lampp文件夹/文件。

/etc/mysql$ ls
mariadb.conf.d  mysql.conf.d

mariadb.conf.d有50-client.cnf.dpkg-new 50-mysql-clients.cnf.dpkg-new 60-galera.cnf.dpkg-new并且mysql.conf.d是空的。

$ locate mysql.cnf
/etc/mysql/mysql.cnf
/etc/mysql/mysql.conf.d/mysql.cnf

但

/etc/mysql/mysql.conf.d$ cat mysql.cnf
cat: mysql.cnf: No such file or directory
$ cat /var/log/mysql/error.log
2022-10-25T07:48:52.228831Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.31-0ubuntu0.22.04.1) initializing of server in progress as process 28839
2022-10-25T07:48:52.302162Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-25T07:49:09.874747Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-25T07:50:06.236820Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2022-10-25T07:51:08.281884Z 6 [System] [MY-013172] [Server] Received SHUTDOWN from user boot. Shutting down mysqld (Version: 8.0.31-0ubuntu0.22.04.1).
2022-10-25T07:51:38.826105Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31-0ubuntu0.22.04.1) starting as process 28898
2022-10-25T07:51:39.554318Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-25T07:51:41.855856Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-25T07:51:46.281301Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-10-25T07:51:46.281340Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-10-25T07:51:46.333725Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
2022-10-25T07:51:46.379072Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
2022-10-25T07:51:46.379082Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.31-0ubuntu0.22.04.1'  socket: '/tmp/tmp.AGSySmwCxw/mysqld.sock'  port: 0  (Ubuntu).
2022-10-25T07:51:46.647513Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.31-0ubuntu0.22.04.1).
2022-10-25T07:51:51.615872Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31-0ubuntu0.22.04.1)  (Ubuntu).
2022-10-25T07:51:52.202270Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31-0ubuntu0.22.04.1) starting as process 28983
2022-10-25T07:51:52.209027Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-25T07:51:54.558257Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-25T07:51:57.829629Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-10-25T07:51:57.829657Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-10-25T07:51:57.889261Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
2022-10-25T07:51:58.081569Z 7 [System] [MY-013172] [Server] Received SHUTDOWN from user boot. Shutting down mysqld (Version: 8.0.31-0ubuntu0.22.04.1).
2022-10-25T07:51:58.085366Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '127.0.0.1' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2022-10-25T07:52:01.902843Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31-0ubuntu0.22.04.1)  (Ubuntu).
2022-10-25T07:52:03.914295Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31-0ubuntu0.22.04.1) starting as process 29105
2022-10-25T07:52:04.447669Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-25T07:52:06.721404Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-25T07:52:10.519027Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-10-25T07:52:10.519055Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-10-25T07:52:10.536998Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '127.0.0.1' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2022-10-25T07:52:10.537077Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.31-0ubuntu0.22.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
2022-10-25T08:14:19.130322Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31-0ubuntu0.22.04.1) starting as process 1057
2022-10-25T08:14:20.074090Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-25T08:14:33.814659Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-25T08:14:37.852644Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
2022-10-25T08:14:37.862734Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
2022-10-25T08:14:38.881437Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-10-25T08:14:38.881467Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-10-25T08:14:39.184636Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '127.0.0.1' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2022-10-25T08:14:39.184667Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.31-0ubuntu0.22.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
2022-10-25T08:27:57.845047Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.31-0ubuntu0.22.04.1).
2022-10-25T08:27:59.876899Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31-0ubuntu0.22.04.1)  (Ubuntu).
mysql lamp
  • 1 个回答
  • 57 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve