Innodb

MySQL 5.5 啟動 Fedora 16 失敗

  • December 4, 2015

我從儲存庫(MySQL 5.5 版)安裝了 mysql 和 mysql-server。然後嘗試啟動它,但出現錯誤。

[root@server]# service mysqld start
Redirecting to /bin/systemctl start  mysqld.service
Job failed. See system logs and 'systemctl status' for details.

這是日誌:

121118  2:41:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
121118  2:41:38 [Note] Plugin 'FEDERATED' is disabled.
121118  2:41:38 InnoDB: The InnoDB memory heap is disabled
121118  2:41:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121118  2:41:38 InnoDB: Compressed tables use zlib 1.2.5
121118  2:41:38 InnoDB: Using Linux native AIO /usr/libexec/mysqld: Can't create/write to file '/tmp/ibhsfQfU' (Errcode: 13)
121118  2:41:38  InnoDB: Error: unable to create temporary file; errno: 13
121118  2:41:38 [ERROR] Plugin 'InnoDB' init function returned error.
121118  2:41:38 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121118  2:41:38 [ERROR] Unknown/unsupported storage engine: InnoDB
121118  2:41:38 [ERROR] Aborting

121118  2:41:38 [Note] /usr/libexec/mysqld: Shutdown complete

121118 02:41:38 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

全新安裝,在此之前沒有任何變化,只是執行 yum update。

這是 systemctl 狀態跟踪

[root@linyansho /]# systemctl status mysqld.service
mysqld.service - MySQL database server
 Loaded: loaded (/lib/systemd/system/mysqld.service; disabled)
 Active: failed since Sun, 18 Nov 2012 02:45:19 +0300; 5min ago
 Process: 864 ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID (code=exited, status=1/FAILURE)
 Process: 863 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
 Process: 842 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 CGroup: name=systemd:/system/mysqld.service

確保 / 和數據目錄中有足夠的空間。

  1. 在 ps -ef | 中殺死 mysql 的所有程序 grep -i mysql
  2. 如果您看到在預設數據目錄下生成的任何 ibdata 文件,您也可以將它們刪除 iblogfile1,2,因為它是全新安裝,無需安全備份它們。
  3. chown -R mysql:root /var/lib/mysql
  4. chmod -R 775 /var/lib/mysql 對 /etc/my.cnf 也有同樣的權限。
  5. 現在嘗試通過發出 /etc/init.d/mysql start 和 tail -f /var/log/mysqld.log 來啟動實例。如果您收到任何錯誤消息,它應該毫無問題地開始。

檢查臨時文件權限。

腳步:

  1. 轉到您的my.cnf文件並找到tmpdir變數。這將是類似的東西tmpdir=/var/untd/tmp
  2. 更改文件權限,如下所示。
chown mysql:mysql /var/untd/tmp
  1. 現在你可以使用啟動 MySQLmysqld_safe
mysqld_safe --user=root&

引用自:https://dba.stackexchange.com/questions/28864