標籤:mic shu cti compress iba inux mon init rw_lock
本來mysql好的,之前清理了一次tmp下的東西,mysql在查詢的時候提示:
Can‘t create/write to file ‘/tmp/ib0n3frL
然後停止啟動:
[[email protected]_linux mysql]# service mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
啟動失敗了,看一下日誌,發現配置的時候沒添加日誌配置
尋找my.cnf,在[mysqld]下添加log-error=/var/log/mysql/mysql-error.log
配置mysql的錯誤記錄檔,mysql目錄自行設定,其中記住一點,chown -R mysql:mysql /tmp/mysql
賦予mysql目錄許可權,因為我是root, mysql運行許可權為mysql,沒有許可權
再啟動mysql嘗試:
180222 10:45:28 InnoDB: Mutexes and rw_locks use GCC atomic builtins180222 10:45:28 InnoDB: Compressed tables use zlib 1.2.3180222 10:45:28 InnoDB: Using Linux native AIO^G/usr/libexec/mysqld: Can‘t create/write to file ‘/tmp/mysql_data/ibAGn543‘ (Errcode: 13)180222 10:45:28 InnoDB: Error: unable to create temporary file; errno: 13180222 10:45:28 [ERROR] Plugin ‘InnoDB‘ init function returned error.180222 10:45:28 [ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed.180222 10:45:28 [ERROR] Unknown/unsupported storage engine: InnoDB180222 10:45:28 [ERROR] Aborting180222 10:45:28 [Note] /usr/libexec/mysqld: Shutdown complete
原來是Can‘t create/write to file,那麼就好解決了,看看mysql_data目錄是否存在。
chmod -R 777 /tmp
賦予寫的許可權,啟動mysql:
[email protected]_linux mysql]# service mysqld startStarting mysqld: [ OK ]
just do it.
小記一次mysql啟動失敗沒有日誌的處理