本來mysql好的,之前清理了一次tmp下的東西,mysql在查詢的時候提示:
Can't create/write to file '/tmp/ib0n3frL
然後停止啟動:
[root@sevck_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 builtins
180222 10:45:28 InnoDB: Compressed tables use zlib 1.2.3
180222 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: 13
180222 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: InnoDB
180222 10:45:28 [ERROR] Aborting
180222 10:45:28 [Note] /usr/libexec/mysqld: Shutdown complete
原來是Can't create/write to file,那麼就好解決了,看看mysql_data目錄是否存在。
chmod -R 777 /tmp
賦予寫的權限,啟動mysql:
root@sevck_linux mysql]# service mysqld start
Starting mysqld: [ OK ]
just do it.
【版權所有@Sevck 部落格位址http://www.cnblogs.com/sevck】 可以轉載,注明出處.