刚装完的lnmp,reboot一下mysql就启动不起来了,问题困扰了我两天,重装至少6次以上
主要报2个错误,一个是说mysql is not running ,but pid file exeited还有一个是说the server quit without updating PID file。对于第一个错误,我强制指定了一个不可删除的pid文件
chattr +i /usr/local/mysql/var/vultr.guest.pid
自己往里面随便写了个进程id,然并卵,还是起不起来。
然后我又把pid文件删了。
service mysql status显示信息如下: ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) existsrm -rf /var/lock/subsys/mysql
再启动mysql,依旧然并卵:Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/var/vultr.guest.pid).实在搞不定了,只能请军哥出马。。。。
错误日志如下:151103 18:03:33 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
2015-11-03 18:03:34 11391 Plugin 'FEDERATED' is disabled.
2015-11-03
18:03:34 7fcef2ac7740 InnoDB: Warning: Using
innodb_additional_mem_pool_size is DEPRECATED. This option may be
removed in future releases, together with the option
innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-11-03 18:03:34 11391 InnoDB: Using atomics to ref count buffer pool pages
2015-11-03 18:03:34 11391 InnoDB: The InnoDB memory heap is disabled
2015-11-03 18:03:34 11391 InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-03 18:03:34 11391 InnoDB: Memory barrier is not used
2015-11-03 18:03:34 11391 InnoDB: Compressed tables use zlib 1.2.3
2015-11-03 18:03:34 11391 InnoDB: Using CPU crc32 instructions
2015-11-03 18:03:34 11391 InnoDB: Initializing buffer pool, size = 16.0M
2015-11-03 18:03:34 11391 InnoDB: Completed initialization of buffer pool
2015-11-03 18:03:34 11391 InnoDB: Highest supported file format is Barracuda.
2015-11-03 18:03:34 11391 InnoDB: 128 rollback segment(s) are active.
2015-11-03 18:03:34 11391 InnoDB: Waiting for purge to start
2015-11-03 18:03:34 11391 InnoDB: 5.6.23 started; log sequence number 1626180
2015-11-03
18:03:34 11391 /usr/local/mysql/bin/mysqld: unknown variable
'log-slow-queries=/usr/local/mysql/log/slowquery.log'
2015-11-03 18:03:34 11391 Aborting
2015-11-03 18:03:34 11391 Binlog end
2015-11-03 18:03:34 11391 Shutting down plugin 'partition'
2015-11-03 18:03:34 11391 Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-11-03 18:03:34 11391 Shutting down plugin 'ARCHIVE'
2015-11-03 18:03:34 11391 Shutting down plugin 'BLACKHOLE'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_SYS_FIELDS'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_SYS_INDEXES'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_SYS_TABLES'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_FT_CONFIG'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_FT_DELETED'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_METRICS'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_CMPMEM'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_CMP_RESET'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_CMP'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_LOCK_WAITS'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_LOCKS'
2015-11-03 18:03:34 11391 Shutting down plugin 'INNODB_TRX'
2015-11-03 18:03:34 11391 Shutting down plugin 'InnoDB'
2015-11-03 18:03:34 11391 InnoDB: FTS optimize thread exiting.
2015-11-03 18:03:34 11391 InnoDB: Starting shutdown...
2015-11-03 18:03:35 11391 InnoDB: Shutdown completed; log sequence number 1626190
2015-11-03 18:03:35 11391 Shutting down plugin 'MRG_MYISAM'
2015-11-03 18:03:35 11391 Shutting down plugin 'MyISAM'
2015-11-03 18:03:35 11391 Shutting down plugin 'CSV'
2015-11-03 18:03:35 11391 Shutting down plugin 'MEMORY'
2015-11-03 18:03:35 11391 Shutting down plugin 'sha256_password'
2015-11-03 18:03:35 11391 Shutting down plugin 'mysql_old_password'
2015-11-03 18:03:35 11391 Shutting down plugin 'mysql_native_password'
2015-11-03 18:03:35 11391 Shutting down plugin 'binlog'
2015-11-03 18:03:35 11391 /usr/local/mysql/bin/mysqld: Shutdown complete
151103 18:03:35 mysqld_safe mysqld from pid file /usr/local/mysql/var/vultr.guest.pid endedmy.cnf的配置文件如下:# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
port = 3306
socket = /tmp/mysql.sock
datadir = /usr/local/mysql/var
pid-file=/usr/local/mysql/var/vultr.guest.pid
skip-external-locking
max_connections = 1000
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
explicit_defaults_for_timestamp=true
#log
log-error=/usr/local/mysql/log/error.log
general_log=ON
general_log_file=/usr/local/mysql/log/mysql.log
long_query_time=2
log-slow-queries= /usr/local/mysql/log/slowquery.log
#skip-networking
#log-bin=mysql-bin
# binary logging format - mixed recommended
#binlog_format=mixed
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
#loose-innodb-trx=0
#loose-innodb-locks=0
#loose-innodb-lock-waits=0
#loose-innodb-cmp=0
#loose-innodb-cmp-per-index=0
#loose-innodb-cmp-per-index-reset=0
#loose-innodb-cmp-reset=0
#loose-innodb-cmpmem=0
#loose-innodb-cmpmem-reset=0
#loose-innodb-buffer-page=0
#loose-innodb-buffer-page-lru=0
#loose-innodb-buffer-pool-stats=0
#loose-innodb-metrics=0
#loose-innodb-ft-default-stopword=0
#loose-innodb-ft-inserted=0
#loose-innodb-ft-deleted=0
#loose-innodb-ft-being-deleted=0
#loose-innodb-ft-config=0
#loose-innodb-ft-index-cache=0
#loose-innodb-ft-index-table=0
#loose-innodb-sys-tables=0
#loose-innodb-sys-tablestats=0
#loose-innodb-sys-indexes=0
#loose-innodb-sys-columns=0
#loose-innodb-sys-fields=0
#loose-innodb-sys-foreign=0
#loose-innodb-sys-foreign-cols=0
# Uncomment the following if you are using InnoDB tables
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磁盘空间肯定是够的:
[ 本帖最后由 work4seo 于 2015-11-3 19:04 编辑 ]
已经确定开启了慢查询功能,错误日志里面我也很蛋疼
[ 本帖最后由 work4seo 于 2015-11-3 18:56 编辑 ] 1、pid就是pid,不是你想控制就控制的,这个是mysql自动创建管理的
2、日志里有错误信息
18:03:34 11391 /usr/local/mysql/bin/mysqld: unknown variable
'log-slow-queries=/usr/local/mysql/log/slowquery.log'
2015-11-03 18:03:34 11391 Aborting
你mysql是5.6参数应该用slow-query-log-file,你上面的参数已经不用了
页:
[1]