No such file or directory - /tmp/mysql.sock

本文介绍如何在bash环境下通过修改database.yml文件中的socket配置路径为/var/lib/mysql/mysql.sock来解决MySQL连接问题,并确认更改后重启服务器。
在bash下
$ mysql
$ status

其中一行

UNIX socket: /var/lib/mysql/mysql.sock


修改database.yml的

socket:/var/lib/mysql/mysql.sock


重启服务器 OK

原文链接:http://blog.youkuaiyun.com/windytwang/archive/2007/04/02/1549195.aspx
2025-10-15 19:10:24-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:10:24-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.stwigavUlr mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted! 2025-10-15 19:10:25-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:10:25-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.op7tb9Mdfu mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted! 2025-10-15 19:10:25-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:10:25-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.s1LLDsriNy mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted! 2025-10-15 19:10:26-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:10:26-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.g1qrC39673 mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted! 2025-10-15 19:10:27-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:10:27-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.DeykjGiFdW mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted! 2025-10-15 19:10:29-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:10:29-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.ASWVMuqZxQ mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted! 2025-10-15 19:10:33-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:10:33-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.RU4kFFChUm mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted! 2025-10-15 19:10:40-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:10:40-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.hWvxNRVJN2 mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted! 2025-10-15 19:10:53-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:10:53-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.1Ld8vDgEi6 mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted! 2025-10-15 19:11:19-07:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started. 2025-10-15 19:11:19-07:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.L2PWtSWltQ mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/[mysqld]' (Errcode: 2 - No such file or directory) mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
10-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值