[root@iZ286290rd2Z ~]# mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) [root@iZ286290rd2Z ~]# ps auxww | grep mysql
去看了下 MySQL日志 里面记录的只是启动的日志
重启之后告诉我异常关闭,服务是可以正常运行了
150717 11:44:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 150717 11:44:41 InnoDB: Initializing buffer pool, size = 8.0M 150717 11:44:41 InnoDB: Completed initialization of buffer pool InnoDB: The log sequence number in ibdata files does not match InnoDB: the log sequence number in the ib_logfiles! 150717 11:44:41 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 150717 11:44:42 InnoDB: Started; log sequence number 0 11403911 150717 11:44:42 [Note] Event Scheduler: Loaded 0 events 150717 11:44:42 [Note] /usr/libexec/mysqld: ready for connections. Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
[root@iZ286290rd2Z ~]# ps auxww| grep mysql root 17953 0.0 0.0 100944 324 pts/0 S+ 11:43 0:00 tail -f mysqld.log root 18015 0.0 0.1 106100 620 pts/1 S 11:44 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql mysql 18117 0.1 3.7 444788 18896 pts/1 Sl 11:44 0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock root 18202 0.0 0.1 103252 836 pts/1 S+ 11:48 0:00 grep mysql
看MySQL 日志 和系统日志分析估计是由于服务器内存不足引起。