2

我已经下载了 mysql 二进制文件,我正在尝试按照此处的说明进行安装。当我尝试运行bin/mysqld_safe --user=mysql &命令时,我得到以下输出:

40211 19:04:56 mysqld_safe 记录到“/usr/local/mysql/data/irpowerweb.err”。
140211 19:04:56 mysqld_safe 使用来自 /usr/local/mysql/data 的数据库启动 mysqld 守护进程
140211 19:04:57 来自 pid 文件 /usr/local/mysql/data/irpowerweb.pid 的 mysqld_safe mysqld 结束

错误日志的内容是:

140211 19:07:01 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2014-02-11 19:07:02 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-02-11 19:07:02 19511 [Note] Plugin 'FEDERATED' is disabled.
2014-02-11 19:07:02 19511 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2014-02-11 19:07:02 19511 [Note] InnoDB: The InnoDB memory heap is disabled
2014-02-11 19:07:02 19511 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2014-02-11 19:07:02 19511 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-02-11 19:07:02 19511 [Note] InnoDB: Using Linux native AIO
2014-02-11 19:07:02 19511 [Note] InnoDB: Not using CPU crc32 instructions
2014-02-11 19:07:02 19511 [Note] InnoDB: Initializing buffer pool, size = 64.0M
InnoDB: mmap(68370432 bytes) failed; errno 12
2014-02-11 19:07:02 19511 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2014-02-11 19:07:02 19511 [ERROR] Plugin 'InnoDB' init function returned error.
2014-02-11 19:07:02 19511 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-02-11 19:07:02 19511 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-02-11 19:07:02 19511 [ERROR] Aborting

2014-02-11 19:07:02 19511 [Note] Binlog end

...
Shutting down stuff
...

2014-02-11 19:07:02 19511 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140211 19:07:02 mysqld_safe mysqld from pid file /usr/local/mysql/data/irpowerweb.pid ended

这是my.cnf

[mysqld]
innodb_buffer_pool_size = 64M    
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

我只想让 mysql 以 w/e 方式运行。我尝试使用 安装包yum install mysql-server,下载 rpm 包,但未能启动。我选择了简单的 tar 包并开始按照上面的链接进行操作,但我又一次未能启动它。
由于错误状态Cannot allocate memory for the buffer pool,我尝试将内存减少到 64m(默认为 128m),但没有成功。我是这方面的新手,我已经做了很多搜索,还没有弄清楚如何解决这个问题。

PS 如果有帮助,我正在使用 ssh 连接到内存不足的服务器(512MB 内存,没有交换),我认为这是一个红帽 Linux。

4

3 回答 3

2

我在这里找到了答案。使用了以下 my.cnf 并且它有效:

[mysqld] 
innodb=OFF 
ignore-builtin-innodb 
skip-innodb
default-storage-engine=myisam 
default-tmp-storage-engine=myisam
于 2014-02-12T10:35:58.933 回答
1

您最严重的错误是:

无法为缓冲池分配内存

你必须降低它,在my.cnf.

当您运行时freemysqld_safe已经完成清理,因此您必须通过另一个终端监控内存。my.cnf但是默认值会耗尽您的可用内存是很正常的。这是 Debian 不附带默认 my.cnf 配置的原因之一。

更新:以防万一,请确保:

  • 遵循MySQL Tuner为您的系统提供的建议。
  • 确保 SELinux 已关闭或设置为允许 mysql
  • 使用确保您的堆栈大小足够大ulimit -s(您可以增加它:ulimit -s <new_size>甚至ulimit -s unlimited
于 2014-02-11T16:26:36.010 回答
1

尝试添加:

[mysqld]
...
skip-bdb
skip-innodb

这将完全阻止 Berkley DB 和 InnoDB 的启动。

于 2014-02-11T16:36:24.617 回答