本文主要是介绍[MY-010273] [Server] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.问题解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
博文背景
本人在Ubuntu20.04系统下使用apt安装MySQL8后直接使用mysqld命令启动会发现无法启动成功,查看日志遇到[MY-010273] [Server] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.的报错。
日志分析
2020-09-25T01:23:33.191419Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 1712
2020-09-25T01:23:33.206763Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-09-25T01:23:33.476816Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-09-25T01:23:33.593919Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
2020-09-25T01:23:33.594205Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
2020-09-25T01:23:33.698046Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-09-25T01:23:33.698308Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2020-09-25T01:23:33.699494Z 0 [ERROR] [MY-010273] [Server] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.
2020-09-25T01:23:33.699672Z 0 [ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
2020-09-25T01:23:33.700047Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-09-25T01:23:35.142583Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21-0ubuntu0.20.04.4) (Ubuntu).
会发现无法在/var/run/mysqld目录下创建套接字文件。
解决办法
很可能是权限不足,创建/var/run/mysqld目录然后将其授权给MySQL用户即可。
参考链接
https://blog.csdn.net/yabingshi_tech/article/details/51051922?utm_source=blogxgwz4
这篇关于[MY-010273] [Server] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.问题解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!