lwj1435 发表于 2016-3-9 10:42:30

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

* 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/
还是重启后报这个错

licess 发表于 2016-3-9 11:33:18

发mysql日志

lwj1435 发表于 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)
1603090:02:11 Aborting

1603090:02:11 /usr/local/mysql/bin/mysqld: Shutdown complete

160309 00:02:11 mysqld_safe mysqld from pid file /usr/local/mysql/data/iZ28ll5pvsxZ.pid ended

licess 发表于 2016-3-9 13:42:51

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

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

一般只需要chown mysql:mysql 数据库目录,不要chmod

lwj1435 发表于 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=

lwj1435 发表于 2016-3-9 14:28:59

是要改成var文件夹么?

lwj1435 发表于 2016-3-9 14:33:04

我改了还是报这个错!,我重装了也是这个错~

lwj1435 发表于 2016-3-9 14:36:12

也用了chown -Rf mysql:mysql还是没用,还是这个错误!

licess 发表于 2016-3-9 16:30:31

回复 8# 的帖子

看配置文件 /etc/my.cnf 里的设置

lwj1435 发表于 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


quick
max_allowed_packet = 16M


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


key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M


interactive-timeout

expire_logs_days = 10

lwj1435 发表于 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:33InnoDB: Setting file /usr/local/mysql/var/ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
160308 22:56:34InnoDB: 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:34InnoDB: 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:34InnoDB: Waiting for the background threads to start
160308 22:56:35 InnoDB: 5.5.37 started; log sequence number 0
160308 22:56:35 Server hostname (bind-address): '0.0.0.0'; port: 3306
160308 22:56:35    - '0.0.0.0' resolves to '0.0.0.0';
160308 22:56:35 Server socket created on IP: '0.0.0.0'.
160308 22:56:35 Can't start server: Bind on TCP/IP port: Address already in use
160308 22:56:35 Do you already have another mysqld server running on port: 3306 ?
160308 22:56:35 Aborting

160308 22:56:35InnoDB: Starting shutdown...
160308 22:56:36InnoDB: Shutdown completed; log sequence number 1595675
160308 22:56:36 /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:37InnoDB: Waiting for the background threads to start
160308 22:56:38 InnoDB: 5.5.37 started; log sequence number 1595675
160308 22:56:38 Server hostname (bind-address): '0.0.0.0'; port: 3306
160308 22:56:38    - '0.0.0.0' resolves to '0.0.0.0';
160308 22:56:38 Server socket created on IP: '0.0.0.0'.
160308 22:56:38 Can't start server: Bind on TCP/IP port: Address already in use
160308 22:56:38 Do you already have another mysqld server running on port: 3306 ?
160308 22:56:38 Aborting

160308 22:56:38InnoDB: Starting shutdown...
160308 22:56:39InnoDB: Shutdown completed; log sequence number 1595675
160308 22:56:39 /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:15InnoDB: 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:43InnoDB: Waiting for the background threads to start
160309 15:11:44 InnoDB: 5.5.42 started; log sequence number 1625564
160309 15:11:44 Server hostname (bind-address): '0.0.0.0'; port: 3306
160309 15:11:44    - '0.0.0.0' resolves to '0.0.0.0';
160309 15:11:44 Server socket created on IP: '0.0.0.0'.
160309 15:11:44 Can't start server: Bind on TCP/IP port: Address already in use
160309 15:11:44 Do you already have another mysqld server running on port: 3306 ?
160309 15:11:44 Aborting

160309 15:11:44InnoDB: Starting shutdown...
160309 15:11:45InnoDB: Shutdown completed; log sequence number 1625564
160309 15:11:45 /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:08InnoDB: Waiting for the background threads to start
160309 16:30:09 InnoDB: 5.5.42 started; log sequence number 1625564
160309 16:30:09 Server hostname (bind-address): '0.0.0.0'; port: 3306
160309 16:30:09    - '0.0.0.0' resolves to '0.0.0.0';
160309 16:30:09 Server socket created on IP: '0.0.0.0'.
160309 16:30:09 Can't start server: Bind on TCP/IP port: Address already in use
160309 16:30:09 Do you already have another mysqld server running on port: 3306 ?
160309 16:30:09 Aborting

160309 16:30:09InnoDB: Starting shutdown...
160309 16:30:10InnoDB: Shutdown completed; log sequence number 1625564
160309 16:30:10 /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:56InnoDB: Waiting for the background threads to start
160309 16:51:57 InnoDB: 5.5.42 started; log sequence number 1625564
160309 16:51:57 Server hostname (bind-address): '0.0.0.0'; port: 3306
160309 16:51:57    - '0.0.0.0' resolves to '0.0.0.0';
160309 16:51:57 Server socket created on IP: '0.0.0.0'.
160309 16:51:57 Can't start server: Bind on TCP/IP port: Address already in use
160309 16:51:57 Do you already have another mysqld server running on port: 3306 ?
160309 16:51:57 Aborting

160309 16:51:57InnoDB: Starting shutdown...
160309 16:51:58InnoDB: Shutdown completed; log sequence number 1625564
160309 16:51:58 /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

lwj1435 发表于 2016-3-9 16:58:45

root@iZ28ll5pvsxZ:/usr/local/mysql/var# ls
auto.cnfibdata1ib_logfile0ib_logfile1iZ28ll5pvsxZ.errmysqlmysql-bin.000001mysql-bin.indexperformance_schematest
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   10 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   5680 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 323760 16:55 pts/1    00:00:00 grep --color=auto mysqld
这是我的操作记录

lwj1435 发表于 2016-3-9 18:10:34

问题解决了,把原来的mysql停掉,再重新安装就可以了!
页: [1]
查看完整版本: mysql 启动MySQL server PID file could not be found!