mamp pro下mysql启动时报 Bind on unix socket Address already in use的问题处理

一、问题描述
mysql进程无法启动
二、问题分析
检查error log,如下:
180105 21:59:12 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
180105 22:00:30 mysqld_safe Logging to ‘/Applications/MAMP/logs/mysql_error.log’.
180105 22:00:30 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql56
2018-01-05 22:00:30 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2018-01-05 22:00:30 0 [Note] –secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-01-05 22:00:30 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.6.35) starting as process 34383 …
2018-01-05 22:00:30 34383 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql56/ is case insensitive
2018-01-05 22:00:30 34383 [Note] Plugin ‘FEDERATED’ is disabled.
2018-01-05 22:00:30 34383 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-01-05 22:00:30 34383 [Note] InnoDB: The InnoDB memory heap is disabled
2018-01-05 22:00:30 34383 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-01-05 22:00:30 34383 [Note] InnoDB: Memory barrier is not used
2018-01-05 22:00:30 34383 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-01-05 22:00:30 34383 [Note] InnoDB: Using CPU crc32 instructions
2018-01-05 22:00:30 34383 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-01-05 22:00:30 34383 [Note] InnoDB: Completed initialization of buffer pool
2018-01-05 22:00:30 34383 [Note] InnoDB: Highest supported file format is Barracuda.
2018-01-05 22:00:30 34383 [Note] InnoDB: 128 rollback segment(s) are active.
2018-01-05 22:00:30 34383 [Note] InnoDB: Waiting for purge to start
2018-01-05 22:00:30 34383 [Note] InnoDB: 5.6.35 started; log sequence number 252053935
2018-01-05 22:00:30 34383 [Note] RSA private key file not found: /Library/Application Support/appsolute/MAMP PRO/db/mysql56//private_key.pem. Some authentication plugins will not work.
2018-01-05 22:00:30 34383 [Note] RSA public key file not found: /Library/Application Support/appsolute/MAMP PRO/db/mysql56//public_key.pem. Some authentication plugins will not work.
2018-01-05 22:00:30 34383 [Note] Server hostname (bind-address): ‘127.0.0.1’; port: 8889
2018-01-05 22:00:30 34383 [Note] - ‘127.0.0.1’ resolves to ‘127.0.0.1’;
2018-01-05 22:00:30 34383 [Note] Server socket created on IP: ‘127.0.0.1’.
2018-01-05 22:00:30 34383 [ERROR] Can’t start server : Bind on unix socket: Address already in use
2018-01-05 22:00:30 34383 [ERROR] Do you already have another mysqld server running on socket: /Applications/MAMP/tmp/mysql/mysql.sock ?
2018-01-05 22:00:30 34383 [ERROR] Aborting
2018-01-05 22:00:30 34383 [Note] Binlog end
….省略一系列shutting down plugin的操作

上面提示unix socket /tmp/mysql/mysql.sock 被占用,用ps -ef|grep mysql检查没有其它mysql进程.用netstat -an|grep 8889(你的mysql的端口号)检查端口也不存在。
对比分析,正常关闭mysql时,/tmp/mysql/mysql.sock文件是不存在的,而现在mysql已关闭后,还存在/tmp/mysql/mysql.sock文件。
猜测是由于上次mysql未正常关闭或关闭异常引起。
三.问题解决
在root用户下,删除/tmp/mysql/mysql.sock文件,再重启mysql。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值