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

一.问题描述:
 版本:mariadb 10.0.2
启动mysql:
/apps/svr/mariadb10/bin/mysqld_safe --defaults-file=/apps/dbdat/mariadb10_data3306/my3306.cnf  --socket=/tmp/mysql3306.sock &
无法启动,mysql进程退出。

二.问题分析:
检查error log,如下:
160826 15:33:33 [Note] Server socket created on IP: '0.0.0.0'.
160826 15:33:33 [ERROR] Can't start server : Bind on unix socket: Address already in use
160826 15:33:33 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql3306.sock ?
160826 15:33:33 [ERROR] Aborting

160826 15:33:33 [Note] InnoDB: FTS optimize thread exiting.
160826 15:33:33 [Note] InnoDB: Starting shutdown...
160826 15:33:36 [Note] InnoDB: Shutdown completed; log sequence number 452295626292
160826 15:33:36 [Note] /apps/svr/mariadb10/bin/mysqld: Shutdown complete

160826 15:33:36 mysqld_safe mysqld from pid file /apps/dbdat/mariadb10_data3306/mysql.pid ended

上面提示unix socket /tmp/mysql3306.sock 被占用,用ps -ef|grep mysql检查没有其它mysql进程.用netstat -an|grep 3306检查端口也不存在。
对比分析,正常关闭mysql时,/tmp/mysql3306.sock文件是不存在的,而现在mysql已关闭后,还存在/tmp/mysql3306.sock文件。
猜测是由于上次mysql未正常关闭或关闭异常引起。
 

三.问题解决
  在root用户下,删除/tmp/mysql3306.sock文件,再重启mysql。

你可能感兴趣的:(mysql安装启动)