CentOS6.5 64bit系统,配置本地yum源,安装MYSQL数据库,版本5.1.71.当服务器异常断电时,无法启动mysql数据库,造成web服务中断。
重启mysql服务提示:Another MySQL daemon is already running with the same UNIX socket。通过查看日志,解决方法是删
除/var/lib/mysql目录下的mysql.sock文件,然后重启即可。
但如果再次遇到突然断电等情况,还是会出现这种情况,果断GOOGLE,然后发现这貌似是CentOS6.5自身BUG,可参见下面链接:
Bug 1037650 – MySQL server does not restart after unclean reboot
Unable to start MySQL service.
找到从根本上解决问题的方法:
yum -y update mysql-server
不过需要需要将yum源配置成网络yum环境,然后
yum clean
yum list
更新结果如下所示:
[root@localhost yum.repos.d]# yum -y update mysql-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Setting up Update Process
Resolving Dependencies
–> Running transaction check
—> Package mysql-server.x86_64 0:5.1.71-1.el6 will be updated
—> Package mysql-server.x86_64 0:5.1.73-3.el6_5 will be an update
–> Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-server-5.1. 73-3.el6_5.x86_64
–> Running transaction check
—> Package mysql.x86_64 0:5.1.71-1.el6 will be updated
—> Package mysql.x86_64 0:5.1.73-3.el6_5 will be an update
–> Processing Dependency: mysql-libs = 5.1.73-3.el6_5 for package: mysql-5.1.73 -3.el6_5.x86_64
–> Running transaction check
—> Package mysql-libs.x86_64 0:5.1.71-1.el6 will be updated
—> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be an update
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
mysql-server x86_64 5.1.73-3.el6_5 updates 8.6 M
Updating for dependencies:
mysql x86_64 5.1.73-3.el6_5 updates 894 k
mysql-libs x86_64 5.1.73-3.el6_5 updates 1.2 M
Transaction Summary
================================================================================
Upgrade 3 Package(s)
Total download size: 11 M
Downloading Packages:
(1/3): mysql-5.1.73-3.el6_5.x86_64.rpm | 894 kB 00:02
(2/3): mysql-libs-5.1.73-3.el6_5.x86_64.rpm | 1.2 MB 00:03
(3/3): mysql-server-5.1.73-3.el6_5.x86_64.rpm | 8.6 MB 00:21
——————————————————————————–
Total 401 kB/s | 11 MB 00:27
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : mysql-libs-5.1.73-3.el6_5.x86_64 1/6
Updating : mysql-5.1.73-3.el6_5.x86_64 2/6
Updating : mysql-server-5.1.73-3.el6_5.x86_64 3/6
Cleanup : mysql-server-5.1.71-1.el6.x86_64 4/6
Cleanup : mysql-5.1.71-1.el6.x86_64 5/6
Cleanup : mysql-libs-5.1.71-1.el6.x86_64 6/6
Verifying : mysql-libs-5.1.73-3.el6_5.x86_64 1/6
Verifying : mysql-server-5.1.73-3.el6_5.x86_64 2/6
Verifying : mysql-5.1.73-3.el6_5.x86_64 3/6
Verifying : mysql-libs-5.1.71-1.el6.x86_64 4/6
Verifying : mysql-server-5.1.71-1.el6.x86_64 5/6
Verifying : mysql-5.1.71-1.el6.x86_64 6/6
Updated:
mysql-server.x86_64 0:5.1.73-3.el6_5
Dependency Updated:
mysql.x86_64 0:5.1.73-3.el6_5 mysql-libs.x86_64 0:5.1.73-3.el6_5
Complete!
--转自