VPS侦探论坛

 找回密码
 注册
查看: 4474|回复: 2

刚装完的lnmp,reboot一下mysql就启动不起来了,问题困扰了我两天,重装至少6次以上

[复制链接]
发表于 2015-11-3 18:08:01 | 显示全部楼层 |阅读模式

主要报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显示信息如下:
  1. ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
复制代码
rm -rf /var/lock/subsys/mysql
再启动mysql,依旧然并卵:
  1. Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/var/vultr.guest.pid).
复制代码
实在搞不定了,只能请军哥出马。。。。
错误日志如下:
  1. 151103 18:03:33 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
  2. 2015-11-03 18:03:34 11391 [Note] Plugin 'FEDERATED' is disabled.
  3. 2015-11-03
  4. 18:03:34 7fcef2ac7740 InnoDB: Warning: Using
  5. innodb_additional_mem_pool_size is DEPRECATED. This option may be
  6. removed in future releases, together with the option
  7. innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
  8. 2015-11-03 18:03:34 11391 [Note] InnoDB: Using atomics to ref count buffer pool pages
  9. 2015-11-03 18:03:34 11391 [Note] InnoDB: The InnoDB memory heap is disabled
  10. 2015-11-03 18:03:34 11391 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
  11. 2015-11-03 18:03:34 11391 [Note] InnoDB: Memory barrier is not used
  12. 2015-11-03 18:03:34 11391 [Note] InnoDB: Compressed tables use zlib 1.2.3
  13. 2015-11-03 18:03:34 11391 [Note] InnoDB: Using CPU crc32 instructions
  14. 2015-11-03 18:03:34 11391 [Note] InnoDB: Initializing buffer pool, size = 16.0M
  15. 2015-11-03 18:03:34 11391 [Note] InnoDB: Completed initialization of buffer pool
  16. 2015-11-03 18:03:34 11391 [Note] InnoDB: Highest supported file format is Barracuda.
  17. 2015-11-03 18:03:34 11391 [Note] InnoDB: 128 rollback segment(s) are active.
  18. 2015-11-03 18:03:34 11391 [Note] InnoDB: Waiting for purge to start
  19. 2015-11-03 18:03:34 11391 [Note] InnoDB: 5.6.23 started; log sequence number 1626180
  20. 2015-11-03
  21. 18:03:34 11391 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable
  22. 'log-slow-queries=/usr/local/mysql/log/slowquery.log'
  23. 2015-11-03 18:03:34 11391 [ERROR] Aborting

  24. 2015-11-03 18:03:34 11391 [Note] Binlog end
  25. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'partition'
  26. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
  27. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'ARCHIVE'
  28. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'BLACKHOLE'
  29. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
  30. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
  31. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
  32. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
  33. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
  34. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
  35. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
  36. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
  37. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
  38. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
  39. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
  40. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
  41. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
  42. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_FT_DELETED'
  43. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
  44. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_METRICS'
  45. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
  46. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
  47. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
  48. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
  49. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
  50. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
  51. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_CMPMEM'
  52. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_CMP_RESET'
  53. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_CMP'
  54. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
  55. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_LOCKS'
  56. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'INNODB_TRX'
  57. 2015-11-03 18:03:34 11391 [Note] Shutting down plugin 'InnoDB'
  58. 2015-11-03 18:03:34 11391 [Note] InnoDB: FTS optimize thread exiting.
  59. 2015-11-03 18:03:34 11391 [Note] InnoDB: Starting shutdown...
  60. 2015-11-03 18:03:35 11391 [Note] InnoDB: Shutdown completed; log sequence number 1626190
  61. 2015-11-03 18:03:35 11391 [Note] Shutting down plugin 'MRG_MYISAM'
  62. 2015-11-03 18:03:35 11391 [Note] Shutting down plugin 'MyISAM'
  63. 2015-11-03 18:03:35 11391 [Note] Shutting down plugin 'CSV'
  64. 2015-11-03 18:03:35 11391 [Note] Shutting down plugin 'MEMORY'
  65. 2015-11-03 18:03:35 11391 [Note] Shutting down plugin 'sha256_password'
  66. 2015-11-03 18:03:35 11391 [Note] Shutting down plugin 'mysql_old_password'
  67. 2015-11-03 18:03:35 11391 [Note] Shutting down plugin 'mysql_native_password'
  68. 2015-11-03 18:03:35 11391 [Note] Shutting down plugin 'binlog'
  69. 2015-11-03 18:03:35 11391 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

  70. 151103 18:03:35 mysqld_safe mysqld from pid file /usr/local/mysql/var/vultr.guest.pid ended
复制代码
my.cnf的配置文件如下:
  1. # Example MySQL config file for medium systems.
  2. #
  3. # This is for a system with little memory (32M - 64M) where MySQL plays
  4. # an important part, or systems up to 128M where MySQL is used together with
  5. # other programs (such as a web server)
  6. #
  7. # MySQL programs look for option files in a set of
  8. # locations which depend on the deployment platform.
  9. # You can copy this option file to one of those
  10. # locations. For information about these locations, see:
  11. # http://dev.mysql.com/doc/mysql/en/option-files.html
  12. #
  13. # In this file, you can use all long options that a program supports.
  14. # If you want to know which options a program supports, run the program
  15. # with the "--help" option.

  16. # The following options will be passed to all MySQL clients
  17. [client]
  18. #password   = your_password
  19. port        = 3306
  20. socket      = /tmp/mysql.sock

  21. # Here follows entries for some specific programs

  22. # The MySQL server
  23. [mysqld]
  24. port        = 3306
  25. socket      = /tmp/mysql.sock
  26. datadir = /usr/local/mysql/var
  27. pid-file=/usr/local/mysql/var/vultr.guest.pid
  28. skip-external-locking
  29. max_connections = 1000
  30. key_buffer_size = 16M
  31. max_allowed_packet = 1M
  32. table_open_cache = 64
  33. sort_buffer_size = 512K
  34. net_buffer_length = 8K
  35. read_buffer_size = 256K
  36. read_rnd_buffer_size = 512K
  37. myisam_sort_buffer_size = 8M

  38. explicit_defaults_for_timestamp=true
  39. #log
  40. log-error=/usr/local/mysql/log/error.log
  41. general_log=ON
  42. general_log_file=/usr/local/mysql/log/mysql.log
  43. long_query_time=2
  44. log-slow-queries= /usr/local/mysql/log/slowquery.log

  45. #skip-networking

  46. #log-bin=mysql-bin

  47. # binary logging format - mixed recommended
  48. #binlog_format=mixed

  49. # required unique id between 1 and 2^32 - 1
  50. # defaults to 1 if master-host is not set
  51. # but will not function as a master if omitted
  52. server-id   = 1

  53. #loose-innodb-trx=0
  54. #loose-innodb-locks=0
  55. #loose-innodb-lock-waits=0
  56. #loose-innodb-cmp=0
  57. #loose-innodb-cmp-per-index=0
  58. #loose-innodb-cmp-per-index-reset=0
  59. #loose-innodb-cmp-reset=0
  60. #loose-innodb-cmpmem=0
  61. #loose-innodb-cmpmem-reset=0
  62. #loose-innodb-buffer-page=0
  63. #loose-innodb-buffer-page-lru=0
  64. #loose-innodb-buffer-pool-stats=0
  65. #loose-innodb-metrics=0
  66. #loose-innodb-ft-default-stopword=0
  67. #loose-innodb-ft-inserted=0
  68. #loose-innodb-ft-deleted=0
  69. #loose-innodb-ft-being-deleted=0
  70. #loose-innodb-ft-config=0
  71. #loose-innodb-ft-index-cache=0
  72. #loose-innodb-ft-index-table=0
  73. #loose-innodb-sys-tables=0
  74. #loose-innodb-sys-tablestats=0
  75. #loose-innodb-sys-indexes=0
  76. #loose-innodb-sys-columns=0
  77. #loose-innodb-sys-fields=0
  78. #loose-innodb-sys-foreign=0
  79. #loose-innodb-sys-foreign-cols=0

  80. # Uncomment the following if you are using InnoDB tables
  81. innodb_data_home_dir = /usr/local/mysql/var
  82. innodb_data_file_path = ibdata1:10M:autoextend
  83. innodb_log_group_home_dir = /usr/local/mysql/var
  84. # You can set .._buffer_pool_size up to 50 - 80 %
  85. # of RAM but beware of setting memory usage too high
  86. innodb_buffer_pool_size = 16M
  87. innodb_additional_mem_pool_size = 2M
  88. # Set .._log_file_size to 25 % of buffer pool size
  89. innodb_log_file_size = 5M
  90. innodb_log_buffer_size = 8M
  91. innodb_flush_log_at_trx_commit = 1
  92. innodb_lock_wait_timeout = 50

  93. [mysqldump]
  94. quick
  95. max_allowed_packet = 16M

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

  100. [myisamchk]
  101. key_buffer_size = 20M
  102. sort_buffer_size = 20M
  103. read_buffer = 2M
  104. write_buffer = 2M

  105. [mysqlhotcopy]
  106. interactive-timeout

  107. expire_logs_days = 10
复制代码
磁盘空间肯定是够的:


[ 本帖最后由 work4seo 于 2015-11-3 19:04 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2015-11-3 18:53:36 | 显示全部楼层



已经确定开启了慢查询功能,错误日志里面我也很蛋疼

[ 本帖最后由 work4seo 于 2015-11-3 18:56 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2015-11-3 21:09:06 | 显示全部楼层

1、pid就是pid,不是你想控制就控制的,这个是mysql自动创建管理的

2、日志里有错误信息
18:03:34 11391 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable
'log-slow-queries=/usr/local/mysql/log/slowquery.log'
2015-11-03 18:03:34 11391 [ERROR] Aborting

你mysql是5.6参数应该用slow-query-log-file,你上面的参数已经不用了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-17 08:24 , Processed in 0.026757 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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