小記一次mysql啟動失敗沒有日志的處理


本來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.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM