也不知道为什么突然就登不了了,mysql想重启也不行,只好用点日志看看了。找到my.cnf,
然后在最后一段加句log_error = /var/log/mysql/error.log
在/var/log底下创建一下mysql这个目录,然后再次重启,然后查看一下报错记录。
180125 10:10:28 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
2 2018-01-25 10:10:29 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server optio n (see documentation for more details).
3 2018-01-25 10:10:29 30338 [Note] Plugin 'FEDERATED' is disabled.
4 2018-01-25 10:10:29 7fef32867720 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future re leases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
5 2018-01-25 10:10:29 30338 [Note] InnoDB: Using atomics to ref count buffer pool pages
6 2018-01-25 10:10:29 30338 [Note] InnoDB: The InnoDB memory heap is disabled
7 2018-01-25 10:10:29 30338 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
8 2018-01-25 10:10:29 30338 [Note] InnoDB: Memory barrier is not used
9 2018-01-25 10:10:29 30338 [Note] InnoDB: Compressed tables use zlib 1.2.3
10 2018-01-25 10:10:29 30338 [Note] InnoDB: Using CPU crc32 instructions
11 2018-01-25 10:10:29 30338 [Note] InnoDB: Initializing buffer pool, size = 244.0M
12 InnoDB: mmap(261849088 bytes) failed; errno 12
13 2018-01-25 10:10:29 30338 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
14 2018-01-25 10:10:29 30338 [ERROR] Plugin 'InnoDB' init function returned error.
15 2018-01-25 10:10:29 30338 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
16 2018-01-25 10:10:29 30338 [ERROR] Unknown/unsupported storage engine: InnoDB
17 2018-01-25 10:10:29 30338 [ERROR] Aborting
18
19 2018-01-25 10:10:29 30338 [Note] Binlog end
20 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'partition'
21 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
22 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
23 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
24 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
25 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
26 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
27 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
28 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
29 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
30 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
31 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
32 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
33 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
34 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
35 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_FT_DELETED'
36 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
37 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_METRICS'
38 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
39 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
40 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
41 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
42 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
43 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
44 2018-01-25 10:10:29 30338 [Note] Shutting down plugin 'INNODB_CMPMEM'
根据我不成器的英语判断,估计是mysql要占用内存,但是物理内存不够什么的,回到my.cnf,把innodb_buffer_pool_size填小一点,重启,OJBK了