当前位置:   article > 正文

mysql启动失败:[ERROR] [MY-010262] [Server] Can‘t start server: Bind on TCP/IP port: Address already in u_[my-010257] [server] do you already have another m

[my-010257] [server] do you already have another mysqld server running on po

运行systemctl start mysqld.service

结果失败退出,屏幕显示信息如下:

用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 Wed 2022-03-02 02:36:30 UTC; 34s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 45163 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
  Process: 45074 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 45163 (code=exited, status=1/FAILURE)
   Status: "Server startup in progress"
    Error: 98 (Address already in use)

Mar 02 02:36:11 loaclhost systemd[1]: Starting MySQL Server...
Mar 02 02:36:30 loaclhost systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Mar 02 02:36:30 loaclhost systemd[1]: Failed to start MySQL Server.
Mar 02 02:36:30 loaclhost systemd[1]: Unit mysqld.service entered failed state.
Mar 02 02:36:30 loaclhost systemd[1]: mysqld.service failed.

 另外一个命令journalctl -xe也看不到什么有用得信息

这时候需要去查看mysql的启动日志

vi /var/log/mysqld.log

日志里面会记录具体的ERROR,我的ERROR 信息如下:

2022-03-02T02:44:10.470855Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-03-02T02:44:10.471383Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2022-03-02T02:44:10.471415Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2022-03-02T02:44:10.471773Z 0 [ERROR] [MY-010119] [Server] Aborting

因为我的机器上已经启动了另一个docker安装的mysql,所以端口号被占用了。

查看端口号的

lsof -i : 3306

这时需要在mysql的启动配置文件里修改mysql的端口号

vi /etc/my.cnf

添加 port=2022

重洗启动mysql,启动成功。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/628163
推荐阅读
相关标签
  

闽ICP备14008679号