背景:

直接解压安装mysql5.7.18,解压mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz,直接拷贝另外一台数据库的数据目录,启动mysql过程无日志输出,报ERROR! The server quit without updating PID file (/r2/mysqldata/ai244.pid).

排查过程:

重新初始化中......报

bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

可以看到缺乏libaio包

安装libaio后,可以正常启动

  1. [root@(ai244) /usr/local/mysql/support-files]# systemctl start mysql.service
  2. Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
  3. [root@(ai244) /usr/local/mysql/support-files]# systemctl status mysql.service
  4. mysql.service - mysql
  5. Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; vendor preset: disabled)
  6. Active: failed (Result: exit-code) since Sat 2018-07-07 02:17:20 CST; 6s ago
  7. Process: 29011 ExecStart=/usr/local/mysql/support-files/mysql.server start (code=exited, status=1/FAILURE)
  8. Jul 07 02:17:19 ai244 systemd[1]: Starting mysql...
  9. Jul 07 02:17:20 ai244 mysql.server[29011]: Starting MySQL. ERROR! The server quit without updating PID file (/r2/mysqldata/ai244.pid).
  10. Jul 07 02:17:20 ai244 systemd[1]: mysql.service: control process exited, code=exited status=1
  11. Jul 07 02:17:20 ai244 systemd[1]: Failed to start mysql.
  12. Jul 07 02:17:20 ai244 systemd[1]: Unit mysql.service entered failed state.
  13. Jul 07 02:17:20 ai244 systemd[1]: mysql.service failed.
  14. [root@(ai244) /usr/local/mysql/support-files]# netstat -tunlp
  15. Active Internet connections (only servers)
  16. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  17. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1406/sshd
  18. tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1542/master
  19. tcp6 0 0 :::22 :::* LISTEN 1406/sshd
  20. tcp6 0 0 ::1:25 :::* LISTEN 1542/master
  21. [root@(ai244) /usr/local/mysql/support-files]# netstat -tunlp|grep 3306
  22. [root@(ai244) /usr/local/mysql/support-files]# cd /r2
  23. [root@(ai244) /r2]# ll
  24. total 639860
  25. -rw-r--r-- 1 root root 654430368 Dec 5 2017 mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
  26. drwxr-x--- 5 mysql mysql 4096 Jul 7 01:32 mysqldata
  27. -rw-r--r-- 1 root root 591639 Jul 7 01:30 mysqldata.tar.gz
  28. -rw-r--r-- 1 root root 177033 Nov 27 2017 server_audit.so
  29. [root@(ai244) /r2]# ll /etc/my.cnf
  30. -rw-r--r-- 1 root root 6077 Jun 26 15:47 /etc/my.cnf
  31. [root@(ai244) /r2]# df -h
  32. Filesystem Size Used Avail Use% Mounted on
  33. devtmpfs 126G 0 126G 0% /dev
  34. tmpfs 126G 0 126G 0% /dev/shm
  35. tmpfs 126G 9.1M 126G 1% /run
  36. tmpfs 126G 0 126G 0% /sys/fs/cgroup
  37. /dev/sdb3 493G 6.7G 461G 2% /
  38. /dev/sda1 727G 73M 690G 1% /ssd1
  39. /dev/sdb2 976M 118M 792M 13% /boot
  40. /dev/sdb5 6.8T 5.7G 6.4T 1% /usr/local
  41. tmpfs 26G 0 26G 0% /run/user/0
  42. [root@(ai244) /r2]# ll /usr/local/mysql/
  43. total 52
  44. drwxr-xr-x 2 mysql mysql 4096 Jul 6 23:04 bin
  45. -rw-r--r-- 1 mysql mysql 17987 Mar 18 2017 COPYING
  46. drwxr-xr-x 2 mysql mysql 4096 Jul 6 23:04 docs
  47. drwxr-xr-x 3 mysql mysql 4096 Jul 6 23:04 include
  48. drwxr-xr-x 5 mysql mysql 4096 Jul 6 23:04 lib
  49. drwxr-xr-x 4 mysql mysql 4096 Jul 6 23:04 man
  50. -rw-r--r-- 1 mysql mysql 2478 Mar 18 2017 README
  51. drwxr-xr-x 28 mysql mysql 4096 Jul 6 23:04 share
  52. drwxr-xr-x 2 mysql mysql 4096 Jul 6 23:04 support-files
  53. [root@(ai244) /r2]# chmod 755 mysqldata
  54. [root@(ai244) /r2]# ll mysqldata
  55. total 12368
  56. -rw-r----- 1 mysql mysql 217 Jul 6 17:26 binlog.000008
  57. -rw-r----- 1 mysql mysql 28 Jul 6 17:26 binlog.index
  58. -rw-r----- 1 mysql mysql 42464 Jul 6 17:26 error.log
  59. -rw-r----- 1 mysql mysql 322 Jul 6 17:26 ib_buffer_pool
  60. -rw-r----- 1 mysql mysql 12582912 Jul 6 17:25 ibdata1
  61. drwxr-x--- 2 mysql mysql 4096 Jul 6 17:26 mysql
  62. drwxr-x--- 2 mysql mysql 4096 Jul 6 17:26 performance_schema
  63. -rw-r----- 1 mysql mysql 1544 Jul 6 17:26 slow.log
  64. drwxr-x--- 2 mysql mysql 12288 Jul 6 17:26 sys
  65. [root@(ai244) /r2/mysqldata]# cd /usr/local/mysql
  66. [root@(ai244) /usr/local/mysql]# cp -r /r2/mysqldata /r2/mysqldata
  67. mysqldata/ mysqldata.tar.gz
  68. [root@(ai244) /usr/local/mysql]# cp -r /r2/mysqldata /r2/mysqldata.bak
  69. [root@(ai244) /usr/local/mysql]# bin/mysqld --initialize --user=mysql
  70. bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
  71. [root@(ai244) /usr/local/mysql]# rpm -qa|grep libaio
  72. [root@(ai244) /usr/local/mysql]# yum install libaio-devel.x86_64 -y
  73. Loaded plugins: fastestmirror
  74. elrepo | 2.9 kB 00:00:00
  75. local | 3.6 kB 00:00:00
  76. Loading mirror speeds from cached hostfile
  77. * elrepo: hkg.mirror.rackspace.com
  78. Resolving Dependencies
  79. --> Running transaction check
  80. ---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
  81. --> Processing Dependency: libaio(x86-64) = 0.3.109-13.el7 for package: libaio-devel-0.3.109-13.el7.x86_64
  82. --> Running transaction check
  83. ---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
  84. --> Finished Dependency Resolution
  85. Dependencies Resolved
  86. =============================================================================================================================================================================================
  87. Package Arch Version Repository Size
  88. =============================================================================================================================================================================================
  89. Installing:
  90. libaio-devel x86_64 0.3.109-13.el7 local 13 k
  91. Installing for dependencies:
  92. libaio x86_64 0.3.109-13.el7 local 24 k
  93. Transaction Summary
  94. =============================================================================================================================================================================================
  95. Install 1 Package (+1 Dependent package)
  96. Total download size: 37 k
  97. Installed size: 46 k
  98. Downloading packages:
  99. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  100. Total 1.4 MB/s | 37 kB 00:00:00
  101. Running transaction check
  102. Running transaction test
  103. Transaction test succeeded
  104. Running transaction
  105. Installing : libaio-0.3.109-13.el7.x86_64 1/2
  106. Installing : libaio-devel-0.3.109-13.el7.x86_64 2/2
  107. Verifying : libaio-0.3.109-13.el7.x86_64 1/2
  108. Verifying : libaio-devel-0.3.109-13.el7.x86_64 2/2
  109. Installed:
  110. libaio-devel.x86_64 0:0.3.109-13.el7
  111. Dependency Installed:
  112. libaio.x86_64 0:0.3.109-13.el7
  113. Complete!
  114. [root@(ai244) /usr/local/mysql]# systemctl start msyql
  115. Failed to start msyql.service: Unit not found.
  116. [root@(ai244) /usr/local/mysql]# systemctl start mysql
  117. [root@(ai244) /usr/local/mysql]# systemctl status mysql
  118. mysql.service - mysql
  119. Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; vendor preset: disabled)
  120. Active: active (running) since Mon 2018-07-09 16:59:41 CST; 7s ago
  121. Process: 31888 ExecStart=/usr/local/mysql/support-files/mysql.server start (code=exited, status=0/SUCCESS)
  122. Main PID: 31896 (mysqld_safe)
  123. CGroup: /system.slice/mysql.service
  124. ├─31896 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/r2/mysqldata --pid-file=/r2/mysqldata/ai244.pid
  125. └─32738 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/r2/mysqldata --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/r2/mysqldata/error.lo...
  126. Jul 09 16:59:17 ai244 systemd[1]: Starting mysql...
  127. Jul 09 16:59:41 ai244 mysql.server[31888]: Starting MySQL........................ SUCCESS!
  128. Jul 09 16:59:41 ai244 systemd[1]: Started mysql.
  129. [root@(ai244) /usr/local/mysql]# ps -ef |grep mysql
  130. root 31896 1 0 16:59 ? 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/r2/mysqldata --pid-file=/r2/mysqldata/ai244.pid
  131. mysql 32738 31896 8 16:59 ? 00:00:04 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/r2/mysqldata --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/r2/mysqldata/error.log --open-files-limit=10240 --pid-file=/r2/mysqldata/ai244.pid --socket=/r2/mysqldata/mysql.sock --port=3306
  132. root 32821 23827 0 17:00 pts/1 00:00:00 grep --color=auto mysql
  133. [root@(ai244) /usr/local/mysql]# mysql -uroot -piforgot
  134. mysql: [Warning] Using a password on the command line interface can be insecure.
  135. Welcome to the MySQL monitor. Commands end with ; or \g.
  136. Your MySQL connection id is 3
  137. Server version: 5.7.18-log MySQL Community Server (GPL)
  138. Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  139. Oracle is a registered trademark of Oracle Corporation and/or its
  140. affiliates. Other names may be trademarks of their respective
  141. owners.
  142. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  143. (root@localhost) 17:00:21 [(none)]> exit
  144. Bye
  145. [root@(ai244) /usr/local/mysql]#

缺乏libaio包导致报The server quit without updating PID file的更多相关文章

  1. 深度解析MySQL启动时报“The server quit without updating PID file”错误的原因

    很多童鞋在启动mysql的时候,碰到过这个错误, 首先,澄清一点,出现这个错误的前提是:通过服务脚本来启动mysql.通过mysqld_safe或mysqld启动mysql实例并不会报这个错误. 那么 ...

  2. MySQL Error Log 文件丢失导致The server quit without updating PID file启动失败的场景

    今天在做mysql sniff测试的时候,中间重启MySQL实例的过程中,出现了"The server quit without updating PID file"这个经典的错误 ...

  3. mysql修改后启动my.cnf报错Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

    mysql中文乱码解决 mysql修改my.cnf后启动报错Starting MySQL... ERROR! The server quit without updating PID file (/v ...

  4. lnmp下启动mysql报错 The server quit without updating PID file

    启动时候错误代码:Starting MySQL[FAIL.] The server quit without updating PID file (/var/run/mysqld/mysqld.pid ...

  5. mysql启动报错:Starting MySQL...The server quit without updating PID file

    在mysql的data目录下误删除了mysql-bin.000001,mysql-bin.000002等文件,但是没有删除mysql-bin.index文件,此时启动mysql就会报错: Starti ...

  6. MySQL5.6启动报错The server quit without updating PID file

    Mysql启动报错如下: [root@db01 opt]# service mysqld start Starting MySQL.... ERROR! The server quit without ...

  7. 启动mysql报错 -- ERROR! The server quit without updating PID file

    开发说某个测试环境的mysql,无法重启了,报以下错误提示: # service mysqld restart Shutting down MySQL.. SUCCESS! Starting MySQ ...

  8. mysql报错“Starting MySQL...The server quit without updating PID file”处理

    http://blog.csdn.net/lzq123_1/article/details/51354179 注意:要将/usr/bin/mysql_install_db替换成 /usr/bin/my ...

  9. mysql启动报错 The server quit without updating PID file

    [root@uz6542 data]# /etc/init.d/mysqld startStarting MySQL... ERROR! The server quit without updatin ...

随机推荐

  1. 通过ping 主机名,或者主机名对应的IP地址

    通过ping 主机名,或者主机名对应的IP地址: 如下图: 懵了吧? 但是你用 ping 主机名 -4

  2. 数据库连接错误:CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.

    学习Spring整合Hibernate的知识,新建一个工程,代码结构如下: 按如下步骤整合: 代码如下: hibernate.cfg.xml: <?xml version="1.0&q ...

  3. Linux:uniq命令详解

    uniq uniq命令用于报告或忽略文件中的重复行,一般与sort命令结合使用. 语法 uniq(选项)(参数) 选项 -c或——count:在每列旁边显示该行重复出现的次数: -d或--repeat ...

  4. ThinkPHP 连接数据库

    今天在配置连接Mysql 时出现了bool(false)的提示,仔细修改了mysql的密码,还是不对,发现问题应该数据库本身设置了前缀tb_本身的拼写错误和注释掉了 'DB_PREFIX'=>' ...

  5. 每周荐书:云原生、Docker、Web算法(评论送书)

    每周荐书:云原生.Docker.Web算法(评论送书) 感谢大家对每周荐书栏目的支持,先公布下上周中奖名单 名优秀评论可以免费获得此书.   云原生应用架构实践 云原生架构,关注简化开发流程.提升研发 ...

  6. FFmpeg再学习 -- 硬件加速编解码

    为了搞硬件加速编解码,用了一周时间来看 CUDA,接下来开始加以总结. 一.什么是 CUDA (1)首先需要了解一下,什么是 CUDA. 参看:百度百科 -- CUDA 参看:CUDA基础介绍 参看: ...

  7. iOS中求出label中文字的行数和每一行的内容

    今天遇到一个需求,需要计算label中文字的行数.想了好久也没想到好的解决方法,就在网上找了下.结果发现一篇文章是讲这个的.这部分代码不但能够求出一个label中文字行数,更厉害的是能够求出每一行的内 ...

  8. python爬虫入门(2)re模块-正则表达式

    正则表达式 search //匹配第一次遇到符合规则的 匹配IP地址 import re re.search(r'(([01]{0,1}\d{0,1}\d|2[0-4]\d|25[0-5])\.){3 ...

  9. SPU - SKU - ARPU

    商品和单品: 单品:汉语中的“个”  例如,iphone是一个单品,但是在淘宝上当很多商家同时出售这个产品的时候,iphone就是一个商品了 商品:淘宝叫item,京东叫product,商品特指与商家 ...

  10. js之敏感词过滤

    HTML <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <titl ...