VPS侦探论坛

 找回密码
 注册
查看: 5775|回复: 12

[Oracle] mysql 启动MySQL server PID file could not be found!

[复制链接]
发表于 2016-3-9 10:42:30 | 显示全部楼层 |阅读模式

* MySQL server PID file could not be found!
Starting MySQL
... * The server quit without updating PID file (/usr/local/mysql/var/iZ28ll5pvsxZ.pid).

我修改了
chmod -R 755 /usr/local/mysql/
还是重启后报这个错
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-3-9 11:33:18 | 显示全部楼层


发mysql日志
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-3-9 12:02:48 | 显示全部楼层

160309 00:02:11 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
^G/usr/local/mysql/bin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
160309  0:02:11 [ERROR] Aborting

160309  0:02:11 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

160309 00:02:11 mysqld_safe mysqld from pid file /usr/local/mysql/data/iZ28ll5pvsxZ.pid ended
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-3-9 13:42:51 | 显示全部楼层



你自己修改过数据库目录吗?默认目录是在 /usr/local/mysql/var/ 下面

按你上面发的错误信息是权限问题或文件被删除

一般只需要chown mysql:mysql 数据库目录,不要chmod
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-3-9 14:28:26 | 显示全部楼层

etc/init.d/mysql里面写的是:
# Set some defaults
mysqld_pid_file_path=
if test -z "$basedir"
then
  basedir=/usr/local/mysql
  bindir=/usr/local/mysql/bin
  if test -z "$datadir"
  then
    datadir=/usr/local/mysql/data
  fi
  sbindir=/usr/local/mysql/bin
  libexecdir=/usr/local/mysql/bin
else
  bindir="$basedir/bin"
  if test -z "$datadir"
  then
    datadir="$basedir/data"
  fi
  sbindir="$basedir/sbin"
  libexecdir="$basedir/libexec"
fi

# datadir_set is used to determine if datadir was set (and so should be
# *not* set inside of the --basedir= handler.)
datadir_set=

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2016-3-9 14:28:59 | 显示全部楼层

是要改成var文件夹么?
 楼主| 发表于 2016-3-9 14:33:04 | 显示全部楼层

我改了还是报这个错!,我重装了也是这个错~
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-3-9 14:36:12 | 显示全部楼层

也用了chown -Rf mysql:mysql还是没用,还是这个错误!
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-3-9 16:30:31 | 显示全部楼层

回复 8# 的帖子



看配置文件 /etc/my.cnf 里的设置
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-3-9 16:33:48 | 显示全部楼层



innodb_data_home_dir = /usr/local/mysql/var
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/var
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

expire_logs_days = 10
 楼主| 发表于 2016-3-9 16:55:31 | 显示全部楼层

160308 22:56:33 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
160308 22:56:33 InnoDB: The InnoDB memory heap is disabled
160308 22:56:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160308 22:56:33 InnoDB: Compressed tables use zlib 1.2.3
160308 22:56:33 InnoDB: Using Linux native AIO
160308 22:56:33 InnoDB: Initializing buffer pool, size = 16.0M
160308 22:56:33 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file /usr/local/mysql/var/ibdata1 did not exist:
InnoDB: a new database to be created!
160308 22:56:33  InnoDB: Setting file /usr/local/mysql/var/ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
160308 22:56:34  InnoDB: Log file /usr/local/mysql/var/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /usr/local/mysql/var/ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
160308 22:56:34  InnoDB: Log file /usr/local/mysql/var/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /usr/local/mysql/var/ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
160308 22:56:34  InnoDB: Waiting for the background threads to start
160308 22:56:35 InnoDB: 5.5.37 started; log sequence number 0
160308 22:56:35 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160308 22:56:35 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
160308 22:56:35 [Note] Server socket created on IP: '0.0.0.0'.
160308 22:56:35 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
160308 22:56:35 [ERROR] Do you already have another mysqld server running on port: 3306 ?
160308 22:56:35 [ERROR] Aborting

160308 22:56:35  InnoDB: Starting shutdown...
160308 22:56:36  InnoDB: Shutdown completed; log sequence number 1595675
160308 22:56:36 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

160308 22:56:36 mysqld_safe mysqld from pid file /usr/local/mysql/var/iZ28ll5pvsxZ.pid ended
160308 22:56:37 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
160308 22:56:37 InnoDB: The InnoDB memory heap is disabled
160308 22:56:37 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160308 22:56:37 InnoDB: Compressed tables use zlib 1.2.3
160308 22:56:37 InnoDB: Using Linux native AIO
160308 22:56:37 InnoDB: Initializing buffer pool, size = 16.0M
160308 22:56:37 InnoDB: Completed initialization of buffer pool
160308 22:56:37 InnoDB: highest supported file format is Barracuda.
160308 22:56:37  InnoDB: Waiting for the background threads to start
160308 22:56:38 InnoDB: 5.5.37 started; log sequence number 1595675
160308 22:56:38 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160308 22:56:38 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
160308 22:56:38 [Note] Server socket created on IP: '0.0.0.0'.
160308 22:56:38 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
160308 22:56:38 [ERROR] Do you already have another mysqld server running on port: 3306 ?
160308 22:56:38 [ERROR] Aborting

160308 22:56:38  InnoDB: Starting shutdown...
160308 22:56:39  InnoDB: Shutdown completed; log sequence number 1595675
160308 22:56:39 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

160308 22:56:39 mysqld_safe mysqld from pid file /usr/local/mysql/var/iZ28ll5pvsxZ.pid ended
160308 22:58:15 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
160308 22:58:15 InnoDB: The InnoDB memory heap is disabled
160308 22:58:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160308 22:58:15 InnoDB: Compressed tables use zlib 1.2.3
160308 22:58:15 InnoDB: Using Linux native AIO
160308 22:58:15 InnoDB: Initializing buffer pool, size = 16.0M
160308 22:58:15 InnoDB: Completed initialization of buffer pool
160308 22:58:15 InnoDB: highest supported file format is Barracuda.
160308 22:58:15  InnoDB: Waiting for the background threads to start
160308 22:58:16 InnoDB: 5.5.37 started; log sequence number 1595675
"/usr/local/mysql/var/iZ28ll5pvsxZ.err" 1208L, 84548C                                                                                                                                             1,1           Top

160309 14:58:42 mysqld_safe mysqld from pid file /usr/local/mysql/var/iZ28ll5pvsxZ.pid ended
160309 15:11:43 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
160309 15:11:43 InnoDB: The InnoDB memory heap is disabled
160309 15:11:43 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160309 15:11:43 InnoDB: Compressed tables use zlib 1.2.3
160309 15:11:43 InnoDB: Using Linux native AIO
160309 15:11:43 InnoDB: Initializing buffer pool, size = 16.0M
160309 15:11:43 InnoDB: Completed initialization of buffer pool
160309 15:11:43 InnoDB: highest supported file format is Barracuda.
160309 15:11:43  InnoDB: Waiting for the background threads to start
160309 15:11:44 InnoDB: 5.5.42 started; log sequence number 1625564
160309 15:11:44 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160309 15:11:44 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
160309 15:11:44 [Note] Server socket created on IP: '0.0.0.0'.
160309 15:11:44 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
160309 15:11:44 [ERROR] Do you already have another mysqld server running on port: 3306 ?
160309 15:11:44 [ERROR] Aborting

160309 15:11:44  InnoDB: Starting shutdown...
160309 15:11:45  InnoDB: Shutdown completed; log sequence number 1625564
160309 15:11:45 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

160309 15:11:45 mysqld_safe mysqld from pid file /usr/local/mysql/var/iZ28ll5pvsxZ.pid ended
160309 16:30:08 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
160309 16:30:08 InnoDB: The InnoDB memory heap is disabled
160309 16:30:08 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160309 16:30:08 InnoDB: Compressed tables use zlib 1.2.3
160309 16:30:08 InnoDB: Using Linux native AIO
160309 16:30:08 InnoDB: Initializing buffer pool, size = 16.0M
160309 16:30:08 InnoDB: Completed initialization of buffer pool
160309 16:30:08 InnoDB: highest supported file format is Barracuda.
160309 16:30:08  InnoDB: Waiting for the background threads to start
160309 16:30:09 InnoDB: 5.5.42 started; log sequence number 1625564
160309 16:30:09 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160309 16:30:09 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
160309 16:30:09 [Note] Server socket created on IP: '0.0.0.0'.
160309 16:30:09 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
160309 16:30:09 [ERROR] Do you already have another mysqld server running on port: 3306 ?
160309 16:30:09 [ERROR] Aborting

160309 16:30:09  InnoDB: Starting shutdown...
160309 16:30:10  InnoDB: Shutdown completed; log sequence number 1625564
160309 16:30:10 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

160309 16:30:10 mysqld_safe mysqld from pid file /usr/local/mysql/var/iZ28ll5pvsxZ.pid ended
160309 16:51:56 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
160309 16:51:56 InnoDB: The InnoDB memory heap is disabled
160309 16:51:56 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160309 16:51:56 InnoDB: Compressed tables use zlib 1.2.3
160309 16:51:56 InnoDB: Using Linux native AIO
160309 16:51:56 InnoDB: Initializing buffer pool, size = 16.0M
160309 16:51:56 InnoDB: Completed initialization of buffer pool
160309 16:51:56 InnoDB: highest supported file format is Barracuda.
160309 16:51:56  InnoDB: Waiting for the background threads to start
160309 16:51:57 InnoDB: 5.5.42 started; log sequence number 1625564
160309 16:51:57 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160309 16:51:57 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
160309 16:51:57 [Note] Server socket created on IP: '0.0.0.0'.
160309 16:51:57 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
160309 16:51:57 [ERROR] Do you already have another mysqld server running on port: 3306 ?
160309 16:51:57 [ERROR] Aborting

160309 16:51:57  InnoDB: Starting shutdown...
160309 16:51:58  InnoDB: Shutdown completed; log sequence number 1625564
160309 16:51:58 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

160309 16:51:58 mysqld_safe mysqld from pid file /usr/local/mysql/var/iZ28ll5pvsxZ.pid ended

这是完整的error log
 楼主| 发表于 2016-3-9 16:58:45 | 显示全部楼层

root@iZ28ll5pvsxZ:/usr/local/mysql/var# ls
auto.cnf  ibdata1  ib_logfile0  ib_logfile1  iZ28ll5pvsxZ.err  mysql  mysql-bin.000001  mysql-bin.index  performance_schema  test
root@iZ28ll5pvsxZ:/usr/local/mysql/var# rm -Rf mysql-bin.*
root@iZ28ll5pvsxZ:/usr/local/mysql/var# /etc/init.d/mysql restart
* MySQL server PID file could not be found!
Starting MySQL
.. *
root@iZ28ll5pvsxZ:/usr/local/mysql/var# ps -ef|grep mysqld
root       568     1  0 16:55 pts/1    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/iZ28ll5pvsxZ.pid
mysql     1000   568  0 16:55 pts/1    00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/var/iZ28ll5pvsxZ.err --pid-file=/usr/local/mysql/var/iZ28ll5pvsxZ.pid --socket=/tmp/mysql.sock --port=3306
root      1021 32376  0 16:55 pts/1    00:00:00 grep --color=auto mysqld
这是我的操作记录
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-3-9 18:10:34 | 显示全部楼层
问题解决了,把原来的mysql停掉,再重新安装就可以了!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-8 07:58 , Processed in 0.030102 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表