Starting MySQL.. ERROR! The server quit without updating PID file

来自linux中国网wiki
跳到导航 跳到搜索

这个报错 其实是很表面的 今天又遇到了

内存太小问题

问题来了

Starting MySQL.. ERROR! The server quit without updating PID file (/data/apps/mysql/data/centos7vps.pid).

原因和解决办法

本质原因: 查看 errlog 
171107 12:04:13 mysqld_safe Starting mysqld daemon with databases from /data/apps/mysql/data
2017-11-07 12:04:14 0 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
2017-11-07 12:04:14 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-11-07 12:04:14 0 [Note] /data/apps/mysql/bin/mysqld (mysqld 5.6.32-log) starting as process 3800 ...
171107 12:04:15 mysqld_safe mysqld from pid file /data/apps/mysql/data/centos7vps.pid ended


2017-11-07 10:07:56 14679 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-11-07 10:07:56 14679 [Note] InnoDB: The InnoDB memory heap is disabled
2017-11-07 10:07:56 14679 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-11-07 10:07:56 14679 [Note] InnoDB: Memory barrier is not used
2017-11-07 10:07:56 14679 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-11-07 10:07:56 14679 [Note] InnoDB: Using CPU crc32 instructions
2017-11-07 10:07:56 14679 [Note] InnoDB: Initializing buffer pool, size = 2.0G
2017-11-07 10:07:56 14679 [Note] InnoDB: Completed initialization of buffer pool
2017-11-07 10:07:56 14679 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

解决办法

应该是内存不够 因为我的ram 才1G 

这样就好了 
innodb_buffer_pool_size = 500M
当然如果你内存大的 可以这样的 
innodb_buffer_pool_size = 1G
#innodb_buffer_pool_size = 2G


配置文件问题

问题来了

还是那个报错  查看 err log 其实也没什么 问题,那为什么 在qclud上是可以运行的呢  一开始觉得应该是机器问题,而不是打包的rpm包问题
有点新东西 
pid file * ended

 rpm  -ivh ops_mysql_rhel7-5.6.32-1.4.x86_64.rpm 
准备中...                          ################################# [100%]
正在升级/安装...
   1:ops_mysql_rhel7-5.6.32-1.4       ################################# [100%]
Installing MySQL system tables...2017-11-09 08:36:06 0 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
2017-11-09 08:36:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-11-09 08:36:06 0 [Note] ./bin/mysqld (mysqld 5.6.32-log) starting as process 6886 ...
注意:正在将请求转发到“systemctl enable mysqld.service”。
Starting MySQL.. ERROR! The server quit without updating PID file (/data/centos7.pid).
/data/apps/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'

原因和解决办法

期间相看了 所有err log 到处google 也没搞完 忙了一下午呀 最后是想起系统自带的最简单的mysql 配置文件 于是

[root@centos7 intl-3.0.0]# cat /etc/my.cnf

[mysqld]
datadir = /data/apps/mysql/data
socket=/tmp/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/data/logs/mysql/mysqld-error.log
pid-file=/data/apps/mysql/data/centos7vps.pid
#
# include all files from the config directory
!includedir /etc/my.cnf.d

然后就启动成功了 我的天呀 后来 mysql rpm打包直接作了mv /etc/my.cnf 动作了

参考

关于mysql启动问题---mysqld_safe mysqld from pid file * ended

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