MySQL 服务器不会安装到新的操作系统(Debian、Ubuntu)

use*_*175 7 ubuntu debian mysql

今天我想安装(在带有新操作系统的新 VPS 上)一个 MySQL 服务器。

我使用了这个命令:

apt-get install mysql-server mysql-common mysql-client-5.5
Run Code Online (Sandbox Code Playgroud)

我尝试过 Debian 7(x64 和 x86)和 Ubuntu 13.04(x64 和 x86)。

每次我收到此错误消息时:

140223  9:37:33 [Warning] Using unique option prefix key_buffer instead of key_b
uffer_size is deprecated and will be removed in a future release. Please use the
 full name instead.
140223  9:37:33 [Warning] Using unique option prefix myisam-recover instead of m
yisam-recover-options is deprecated and will be removed in a future release. Ple
ase use the full name instead.
140223  9:37:33 [Note] Plugin 'FEDERATED' is disabled.
140223  9:37:33 InnoDB: The InnoDB memory heap is disabled
140223  9:37:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140223  9:37:33 InnoDB: Compressed tables use zlib 1.2.7
140223  9:37:33 InnoDB: Using Linux native AIO
140223  9:37:33  InnoDB: Warning: io_setup() failed with EAGAIN. Will make 5 att
empts before giving up.
InnoDB: Warning: io_setup() attempt 1 failed.
InnoDB: Warning: io_setup() attempt 2 failed.
InnoDB: Warning: io_setup() attempt 3 failed.
InnoDB: Warning: io_setup() attempt 4 failed.
Run Code Online (Sandbox Code Playgroud)

我正在尝试安装 Ubuntu 的视频:http: //youtu.be/nULSfa0xZdU

slm*_*slm 7

通过 my.cnf 禁用

这听起来像是您的问题,标题为:InnoDB:警告:io_setup() 因 EAGAIN 失败。放弃前会尝试5次。

摘抄

你会在其中的某个地方发现这个错误:

    131201 19:22:27 InnoDB: Using Linux native AIO
    131201 19:22:27  InnoDB: Warning: io_setup() failed with EAGAIN. Will make 5 attempts before giving up.
    InnoDB: Warning: io_setup() attempt 1 failed.
    InnoDB: Warning: io_setup() attempt 2 failed.
    InnoDB: Warning: io_setup() attempt 3 failed.
    InnoDB: Warning: io_setup() attempt 4 failed.
    InnoDB: Warning: io_setup() attempt 5 failed.
    131201 19:22:30  InnoDB: Error: io_setup() failed with EAGAIN after 5 attempts.
    InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
    131201 19:22:30 InnoDB: Fatal error: cannot initialize AIO sub-system
Run Code Online (Sandbox Code Playgroud)

那么解决方案是添加:

  innodb_use_native_aio = 0
Run Code Online (Sandbox Code Playgroud)

到 /etc/my.cnf 文件的 [mysqld] 部分。

增加 aio-max-nr

您也可以通过以下方式增加内核设置:

$ cat /proc/sys/fs/aio-max-nr
1048576
Run Code Online (Sandbox Code Playgroud)

可以使用以下命令覆盖诸如此类的内核设置sysctl

$ sudo sysctl -a | grep aio
fs.aio-max-nr = 1048576
fs.aio-nr = 0

$ sysctl -w fs.aio-max-nr=200000
Run Code Online (Sandbox Code Playgroud)

  • 将 innodb_use_native_aio = 0 添加到 mysqld 部分对我有用,不需要做任何其他事情 (2认同)