背景:

直接解压安装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后,可以正常启动

[root@(ai244) /usr/local/mysql/support-files]# systemctl start mysql.service
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
[root@(ai244) /usr/local/mysql/support-files]# systemctl status mysql.service
● mysql.service - mysql
Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2018-07-07 02:17:20 CST; 6s ago
Process: 29011 ExecStart=/usr/local/mysql/support-files/mysql.server start (code=exited, status=1/FAILURE) Jul 07 02:17:19 ai244 systemd[1]: Starting mysql...
Jul 07 02:17:20 ai244 mysql.server[29011]: Starting MySQL. ERROR! The server quit without updating PID file (/r2/mysqldata/ai244.pid).
Jul 07 02:17:20 ai244 systemd[1]: mysql.service: control process exited, code=exited status=1
Jul 07 02:17:20 ai244 systemd[1]: Failed to start mysql.
Jul 07 02:17:20 ai244 systemd[1]: Unit mysql.service entered failed state.
Jul 07 02:17:20 ai244 systemd[1]: mysql.service failed. [root@(ai244) /usr/local/mysql/support-files]# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1406/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1542/master
tcp6 0 0 :::22 :::* LISTEN 1406/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1542/master
[root@(ai244) /usr/local/mysql/support-files]# netstat -tunlp|grep 3306 [root@(ai244) /usr/local/mysql/support-files]# cd /r2
[root@(ai244) /r2]# ll
total 639860
-rw-r--r-- 1 root root 654430368 Dec 5 2017 mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
drwxr-x--- 5 mysql mysql 4096 Jul 7 01:32 mysqldata
-rw-r--r-- 1 root root 591639 Jul 7 01:30 mysqldata.tar.gz
-rw-r--r-- 1 root root 177033 Nov 27 2017 server_audit.so [root@(ai244) /r2]# ll /etc/my.cnf
-rw-r--r-- 1 root root 6077 Jun 26 15:47 /etc/my.cnf
[root@(ai244) /r2]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 126G 0 126G 0% /dev
tmpfs 126G 0 126G 0% /dev/shm
tmpfs 126G 9.1M 126G 1% /run
tmpfs 126G 0 126G 0% /sys/fs/cgroup
/dev/sdb3 493G 6.7G 461G 2% /
/dev/sda1 727G 73M 690G 1% /ssd1
/dev/sdb2 976M 118M 792M 13% /boot
/dev/sdb5 6.8T 5.7G 6.4T 1% /usr/local
tmpfs 26G 0 26G 0% /run/user/0 [root@(ai244) /r2]# ll /usr/local/mysql/
total 52
drwxr-xr-x 2 mysql mysql 4096 Jul 6 23:04 bin
-rw-r--r-- 1 mysql mysql 17987 Mar 18 2017 COPYING
drwxr-xr-x 2 mysql mysql 4096 Jul 6 23:04 docs
drwxr-xr-x 3 mysql mysql 4096 Jul 6 23:04 include
drwxr-xr-x 5 mysql mysql 4096 Jul 6 23:04 lib
drwxr-xr-x 4 mysql mysql 4096 Jul 6 23:04 man
-rw-r--r-- 1 mysql mysql 2478 Mar 18 2017 README
drwxr-xr-x 28 mysql mysql 4096 Jul 6 23:04 share
drwxr-xr-x 2 mysql mysql 4096 Jul 6 23:04 support-files [root@(ai244) /r2]# chmod 755 mysqldata
[root@(ai244) /r2]# ll mysqldata
total 12368
-rw-r----- 1 mysql mysql 217 Jul 6 17:26 binlog.000008
-rw-r----- 1 mysql mysql 28 Jul 6 17:26 binlog.index
-rw-r----- 1 mysql mysql 42464 Jul 6 17:26 error.log
-rw-r----- 1 mysql mysql 322 Jul 6 17:26 ib_buffer_pool
-rw-r----- 1 mysql mysql 12582912 Jul 6 17:25 ibdata1
drwxr-x--- 2 mysql mysql 4096 Jul 6 17:26 mysql
drwxr-x--- 2 mysql mysql 4096 Jul 6 17:26 performance_schema
-rw-r----- 1 mysql mysql 1544 Jul 6 17:26 slow.log
drwxr-x--- 2 mysql mysql 12288 Jul 6 17:26 sys [root@(ai244) /r2/mysqldata]# cd /usr/local/mysql
[root@(ai244) /usr/local/mysql]# cp -r /r2/mysqldata /r2/mysqldata
mysqldata/ mysqldata.tar.gz
[root@(ai244) /usr/local/mysql]# cp -r /r2/mysqldata /r2/mysqldata.bak [root@(ai244) /usr/local/mysql]# bin/mysqld --initialize --user=mysql
bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
[root@(ai244) /usr/local/mysql]# rpm -qa|grep libaio
[root@(ai244) /usr/local/mysql]# yum install libaio-devel.x86_64 -y
Loaded plugins: fastestmirror
elrepo | 2.9 kB 00:00:00
local | 3.6 kB 00:00:00
Loading mirror speeds from cached hostfile
* elrepo: hkg.mirror.rackspace.com
Resolving Dependencies
--> Running transaction check
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
--> Processing Dependency: libaio(x86-64) = 0.3.109-13.el7 for package: libaio-devel-0.3.109-13.el7.x86_64
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================
Installing:
libaio-devel x86_64 0.3.109-13.el7 local 13 k
Installing for dependencies:
libaio x86_64 0.3.109-13.el7 local 24 k Transaction Summary
=============================================================================================================================================================================================
Install 1 Package (+1 Dependent package) Total download size: 37 k
Installed size: 46 k
Downloading packages:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.4 MB/s | 37 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libaio-0.3.109-13.el7.x86_64 1/2
Installing : libaio-devel-0.3.109-13.el7.x86_64 2/2
Verifying : libaio-0.3.109-13.el7.x86_64 1/2
Verifying : libaio-devel-0.3.109-13.el7.x86_64 2/2 Installed:
libaio-devel.x86_64 0:0.3.109-13.el7 Dependency Installed:
libaio.x86_64 0:0.3.109-13.el7 Complete!
[root@(ai244) /usr/local/mysql]# systemctl start msyql
Failed to start msyql.service: Unit not found.
[root@(ai244) /usr/local/mysql]# systemctl start mysql
[root@(ai244) /usr/local/mysql]# systemctl status mysql
● mysql.service - mysql
Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2018-07-09 16:59:41 CST; 7s ago
Process: 31888 ExecStart=/usr/local/mysql/support-files/mysql.server start (code=exited, status=0/SUCCESS)
Main PID: 31896 (mysqld_safe)
CGroup: /system.slice/mysql.service
├─31896 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/r2/mysqldata --pid-file=/r2/mysqldata/ai244.pid
└─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... Jul 09 16:59:17 ai244 systemd[1]: Starting mysql...
Jul 09 16:59:41 ai244 mysql.server[31888]: Starting MySQL........................ SUCCESS!
Jul 09 16:59:41 ai244 systemd[1]: Started mysql.
[root@(ai244) /usr/local/mysql]# ps -ef |grep mysql
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
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
root 32821 23827 0 17:00 pts/1 00:00:00 grep --color=auto mysql
[root@(ai244) /usr/local/mysql]# mysql -uroot -piforgot
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18-log MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. (root@localhost) 17:00:21 [(none)]> exit
Bye
[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. Week14《Java程序设计》第14次作业总结

    Week14<Java程序设计>第14次作业总结 1. 本周学习总结 1.1 以你喜欢的方式(思维导图或其他)归纳总结与数据库相关内容. 2. 使用数据库技术改造你的系统 2.1 简述如何 ...

  2. Sql Server- 性能优化辅助指标SET STATISTICS TIME ON和SET STATISTICS IO ON

    1.前言 对于优化SQL语句或存储过程,以前主要是用如下语句来判断具体执行时间,但是SQL环境是复杂多变的,下面语句并不能精准判断性能是否提高:如果需要精确知道CPU.IO等信息,就无能为力了. 1 ...

  3. Eclipse下配置Maven

    1.修改maven根目录下的conf/setting.xml文件,主要修改localRepository属性,用于管理maven下载的jar文件存放的位置. 2.修改eclipse的maven配置,w ...

  4. 服务上部署jmeter远程机

    1.首先连接服务器 2.在/home下新创建一个自己的文件夹 ]#useradd zhuxiao ]#ls 显示新的用户并在home下创建zhuxiao文件夹 ①切换到用户zhuxiao目录下 ]#s ...

  5. python中处理命令行参数的模块optpars

    optpars是python中用来处理命令行参数的模块,可以自动生成程序的帮助信息,功能强大,易于使用,可以方便的生成标准的,符合Unix/Posix 规范的命令行说明.使用 add_option() ...

  6. iOS RUN LOOP 是个什么东西?

    RUN Loop是什么? 1.runloop是事件接收和分发机制的一个实现. 2.什么时候使用runloop 当需要和该线程进行交互的时候.主线程默认有runloop.当自己启动一个线程,如果只是 ...

  7. 【排序】快速排序,C++实现

    原创博文,转载请注明出处! 本文代码的github地址 # 基本思想 ”快速排序“是对”冒泡排序“的改进. 基本原理:基于分治法,在待排线性表中取一个元素pivot作为枢轴值,通过一趟排序将待排线性表 ...

  8. phpcms打印数据

    <?php echo '<pre>'; var_dump($data); echo '</pre>'; ?>

  9. js检测三角形是否包含一个点

    pointInTriangle:function(x0, y0, x1, y1, x2, y2, x3, y3) { var divisor = (y2 - y3)*(x1 - x3) + (x3 - ...

  10. linux下导入、导出mysql 数据库命令

    一.导出数据库用mysqldump命令(注意mysql的安装路径,即此命令的路径):1.导出数据和表结构:mysqldump -u用户名 -p密码 数据库名 > 数据库名.sql#/usr/lo ...