mysql 多異常 處理 MySQL異常處理彙總

2021-10-17 20:31:35 字數 2011 閱讀 3875

mysql錯誤處理彙總

mysql無法啟動

mysql啟動時提示timeout error occurred trying to start mysql daemon

解決辦法:執行/usr/bin/mysql_install_db,修復下就ok了.

mysql資料表無法使用

啟動後發現所有的資料表都無法使用,檢視mysql異常日誌,發現如下log

[root@ay1212190315567971802 sliuhuamysql]# tail /var/log/mysqld.log

innodb: a big enough maximum process size.

innodb: note that in most 32-bit computers the process

innodb: memory space is limited to 2 gb or 4 gb.

innodb: we keep retrying the allocation for 60 seconds...

130109 12:32:19innodb: fatal error: cannot allocate the memory for the buffer pool

130109 12:32:19 [error] plugin 'innodb' init function returned error.

130109 12:32:19 [error] plugin 'innodb' registration as a storage engine failed.

130109 12:32:19 [note] event scheduler: loaded 0 events

130109 12:32:19 [note] /usr/libexec/mysqld: ready for connections.

version: '5.1.58'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  mysql community server (gpl) by utter ramblings

[root@ay1212190315567971802 sliuhuamysql]# tail -n 20 /var/log/mysqld.log

130109 12:31:17 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

130109 12:31:18 mysqld_safe starting mysqld daemon with databases from /var/lib/mysql

130109 12:31:19  innodb: initializing buffer pool, size = 256.0m

130109 12:31:19  innodb: error: cannot allocate 268451840 bytes of

innodb: memory with malloc! total allocated memory

innodb: by innodb 7994352 bytes. operating system errno: 12

innodb: check if you should increase the swap file or

innodb: ulimits of your operating system.

原因:這個報錯的大意是,記憶體基本耗盡,沒有再可以分配的記憶體.

解決辦法:檢視/etc/my.cnf,找innodb_buffer_pool_size,發現設值已經超過了系統總記憶體,然後重新設定為系統記憶體1半,即innodb_buffer_pool_size = 6144m 重啟mysql就ok了.

支付寶 賞一聽可樂吧~

mysql 多異常 處理 MYSQL效能異常處理

通過information schema.processlist表中的連線資訊生成需要處理掉的mysql連線的語句臨時檔案,然後執行臨時檔案中生成的指令 mysql select concat kill id,from information schema.processlist where use...

mysql異常捕獲 mysql異常處理

error 1130 hy000 host 172.17.0.1 is not allowed to connect to this mysql server use mysql update user set host where user root flush privileges 解決辦法 進...

mysql 異常處理

針對儲存過程 觸發器或函式內部語句可能發生的錯誤或警告資訊,需要進行相關異常或稱 例外的捕捉,然後作出相應的處理,異常處理的方式如下 declare handler for handler actions mysql create table test.t s1 int,primary key s1...