MySQL資料庫啟動失敗問題的處理

2021-10-01 14:35:34 字數 1890 閱讀 5945

mysql資料庫啟動失敗問題的處理【阿里雲伺服器centos7為例】

[root@izbp106mxhd41bfj0bxhuhz ~]# service mysqld start

timeout error occurred trying to start mysql daemon.

starting mysqld: [failed]

說明:遇到mysql資料庫啟動失敗,千萬不要急著進行「rm」或修改「my.cnf」之類的嘗試,rm操作會刪除資料庫,非常危險,謹記!

操作思路:

開啟/var/log/mysqld.log檔案,可以清晰的檢視到問題出現的各種原因,從而對症下藥,比如我的錯誤是:

innodb: error: auto-extending data file ./ibdata1 is of a different size

innodb: 320 pages (rounded down to mb) than specified in the .cnf file:

innodb: initial 640 pages, max 0 (relevant if non-zero) pages!

innodb: could not open or create data files.

innodb: if you tried to add new data files, and it failed here,

innodb: you should now edit innodb_data_file_path in my.cnf back

innodb: to what it was, and remove the new ibdata files innodb created

innodb: in this failed attempt. innodb only wrote those files full of

innodb: zeros, but did not yet use them in any way. but be careful: do not

innodb: remove old data files which contain your precious data!

191220 10:21:33 [error] plugin 『innodb』 init function returned error.

191220 10:21:33 [error] plugin 『innodb』 registration as a storage engine failed.

191220 10:21:33 [error] /usr/libexec/mysqld: error writing file 『/var/run/mysqld/mysqld.pid』 (errcode: 28)

191220 10:21:33 [error] can』t start server: can』t create pid file: no space left on device

191220 10:21:33 mysqld_safe number of processes running now: 0

191220 10:21:33 mysqld_safe mysqld restarted

191220 10:21:34 [warning] 『–default-character-set』 is deprecated and will be removed in a future release. please use 『–character-set-server』 instead.

… …第一行:innodb: error: auto-extending data file ./ibdata1 is of a different size

說明伺服器空間已滿,備份並刪除部分檔案,如等

即可啟動成功。mysql done!

謝謝!

MySQL資料庫插入中文失敗問題

問題描述 建立資料庫test字符集為utf8,表user字符集為utf8。插入中文字元時出現如下錯誤 error 1366 hy000 incorrect string value xce xe2 xd9 xbb for column user name at row 1 解決方法 方法一 在mys...

MySQL建立資料庫失敗

如果使用root賬號登入到資料庫create database時提錯錯誤 mysql 1006 can t create database errno 13 或mysql 1006 can t create database errno 28 一般是mysql使用者沒有目錄許可權的問題。先用linu...

mysql啟動失敗 MySQL 啟動失敗的常見原因

mysql 啟動失敗的最常見的原因有兩類,分別是無法訪問系統資源和引數設定錯誤造成的,下面分別分析如下。一 無法訪問系統資源 mysql 不能訪問啟動需要的資源是造成而 mysql 無法啟動的乙個常見原因,如 檔案,埠等。由於 linux 中用於啟動 mysqld 程序的 mysql 使用者通常是不...