mysql sock 找不到
问题描述
启动时报错
➜ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'(2)
其他目录没有 sock文件
➜ find / -name "*.sock"
/run/chrony/chronyd.sock
启动失败
➜ systemctl start mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
状态
➜ systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 三 2018-09-05 17:18:01 CST; 4min 6s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 5105 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 5082 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 5105 (code=exited, status=1/FAILURE)
Status: "SERVER_BOOTING"
Error: 2 (没有那个文件或目录)
9月 05 17:17:58 ssr.sagiri.me systemd[1]: Starting MySQL Server...
9月 05 17:18:01 ssr.sagiri.me systemd[1]: mysqld.service: main process exited, code=exited, stat...LURE
9月 05 17:18:01 ssr.sagiri.me systemd[1]: Failed to start MySQL Server.
9月 05 17:18:01 ssr.sagiri.me systemd[1]: Unit mysqld.service entered failed state.
9月 05 17:18:01 ssr.sagiri.me systemd[1]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
权限没问题
➜ ll /var/lib/mysql -d
drwxr-x--x 5 mysql mysql 4.0K 9月 5 17:18 /var/lib/mysql
内存
➜ free -h
total used free shared buff/cache available
Mem: 487M 115M 224M 30M 147M 317M
Swap: 0B 0B 0B
mysql日志文件
2018-09-04T05:05:02.255889Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.12) starting as process 8174
2018-09-04T05:05:02.306416Z 0 [ERROR] [MY-012681] [InnoDB] InnoDB: mmap(137428992 bytes) failed; errno 12
2018-09-04T05:05:02.306595Z 1 [ERROR] [MY-012956] [InnoDB] InnoDB: Cannot allocate memory for the buffer pool
2018-09-04T05:05:02.306645Z 1 [ERROR] [MY-012930] [InnoDB] InnoDB: Plugin initialization aborted with error Generic error.
2018-09-04T05:05:02.306770Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2018-09-04T05:05:02.307077Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-09-04T05:05:02.307169Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-09-04T05:05:02.310529Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.12) MySQL Community Server - GPL.
系统 Centos7
mysql 8.0.12
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有权限,内存够吧
排查下
1.内存是否不足
2.读写权限是否够
mysql.sock 是mysql服务启动以后才会有的临时文件。
请参考。
1.检查mysql服务启动是否正常
2.查看/ect/my.cnf 看报错日志的路径,查看日志
3.重新初始化mysql数据库。
安装方式是什么 yum 还是 源码
/etc/my.cnf 配置检查一下。