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

來源:互聯網
上載者:User

標籤: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啟動失敗沒有日誌的處理

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.