主页 > 工作 > mysql.sock问题

mysql.sock问题

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!

原创文章,转载请注明: 转载自三叶草

本文链接地址:http://www.anjing.me/1482.html

特别声明:商业网站转载需经作者同意,否则视为侵权!

,

评论:4

参与评论
  1. 回复 maplebeats 14/08/02

    这个应该算是mysql的问题吧,mysql在启动的时候只是单纯的检查socket文件也是够奇葩的,我似乎也遇见过。

  2. 回复 我操 15/01/17

    卤煮我操 ,啊 ,删了mysql.sock 。还不行 。各种坑爹

    • 回复 三叶草 15/01/29

      生产线环境,你可以mv掉sock文件,不过我是通过删除给解决的。先杀进程。
       
       

发表评论

邮箱地址不会被公开。

*

引用:0

下面所列的是引用到本博客的链接
mysql.sock问题 来自 三叶草
顶部