当前位置:必发365电子游戏 > 操作系统 > google后才知晓这一个并非现阶段使用的安排文件my.cnf
google后才知晓这一个并非现阶段使用的安排文件my.cnf
2019-12-19

在步入正题前,一定要先作弄下本身,近些日子购买了风姿浪漫台Ali云服务器,最开始考虑只是本身个人用的,就买了后生可畏台配置很寒碜的服务器:

以此构造亮出来估算好四人都早已知晓答案了,上面就说下难点每种核实的步骤:

  1. 采纳Xshell远程连接上服务器,使用命令 service mysqld restart重启mysql,提示:

    MySQL server PID file could not be found! [FAILED] Starting MySQL.The server quit without updating PID file(/[FAILED]server/mysql/data/iZ2zeabsxnnfzh13g8yqxjZ.pid).

  2. 去看mysql的谬误日志,但是不明了不当日志在哪个地方,先去找找mysql的my.cnf文件,这里须求注意下,小编在mysql的安装目录下真的找到了叁个my.cnf文件,不过改了不菲安排项发掘未有别的功能,google后才知晓这几个实际不是当前利用的配备文件my.cnf,参照他事他说加以考察那篇小说找到当前接受的布置文件https://my.oschina.net/manech/blog/861991,找到了配置文件(/etc/my.cnf),找到了错误日志之处:

log-error=/alidata/log/mysql/error.log,

  3. 去错误日志看看:

2017-09-03 17:38:21 20390 [Note] InnoDB: The InnoDB memory heap is disabled
2017-09-03 17:38:21 20390 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-09-03 17:38:21 20390 [Note] InnoDB: Memory barrier is not used
2017-09-03 17:38:21 20390 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-09-03 17:38:21 20390 [Note] InnoDB: Using Linux native AIO
2017-09-03 17:38:21 20390 [Note] InnoDB: Using CPU crc32 instructions
2017-09-03 17:38:21 20390 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2017-09-03 17:38:21 20390 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2017-09-03 17:38:21 20390 [ERROR] Plugin ‘InnoDB’ init function returned error.
2017-09-03 17:38:21 20390 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
2017-09-03 17:38:21 20390 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-09-03 17:38:21 20390 [ERROR] Aborting
2017-09-03 17:38:21 20390 [Note] Binlog end
2017-09-03 17:38:21 20390 [Note] Shutting down plugin ‘partition’
2017-09-03 17:38:21 20390 [Note] Shutting down plugin ‘PERFORMANCE_SCHEMA’

google后才知晓这一个并非现阶段使用的安排文件my.cnf。其间标为葡萄紫的就超级首要了,百度Cannot allocate memory for the buffer pool都算得无法给innodb分配丰硕的内部存款和储蓄器,大多数交到的解决的方案是:修正innodb_buffer_pool_size,然则自身这些my.cnf里面没有,那就加三个被呗,顺便将那些字段设置成200M,重启mysql开采生龙活虎律的结果,依然起步不了,去看日志依然同样的标题,还是太大咯?

  4.用free -m看下

              total        used        free      shared  buff/cache   available
Mem:            992         574         159           0         258         260
Swap:             0           0           0

独有185M的内部存款和储蓄器了,只好再改小点咯,改成64.

  5.service mysqld restart,终于

Starting MySQL. [ OK ]

买了风姿浪漫台废柴。。。