[精讚] [會員登入]
1745

[Mysql/Mariadb] 檢查、修復及優化資料庫

mysql/mariadb 檢查、修復及優化資料庫

分享此文連結 //n.sfs.tw/10848

分享連結 [Mysql/Mariadb] 檢查、修復及優化資料庫@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2019-10-23 17:08:24 最後編修
2017-03-03 11:03:14 By 張○○
 

有時因為斷電或是斷連而導致資料庫不正確( corrupted),我們可以使用 mysqlcheck 這個指令來修復,他不需要 root 的權限即可執行。

檢查

參數說明
-u username    以 username 的資料庫權限執行
-p                        使用密碼
-B dbname       指定資料庫 dbname
-c                        檢查

$ mysqlcheck -u axer -p -c -B axerdb
Enter password:
axerdb.acc                              OK
axerdb.ccc                                          OK
axerdb.catalog                                       OK
axerdb.cooperate                                     OK
....以下略

優化及修復

參數說明
-r        修復
-o       優化,不知原理,'o' 是英文字母
-A       指定所有的資料庫

$ mysqlcheck -u axer -p -A -r -o
....


原文 2010-03-01 15:31:47

END

你可能感興趣的文章

[MySQL/Mariadb] console 將查詢結果輸出到檔案 在mysql 的console中該如何將查詢結果輸出到檔案?

兩次使用InnoDB的慘痛經驗 Mysql 的Innodb引擎雖然好用,但是我得說說我兩次的慘痛經驗,這讓我考慮以後可能不會再使用innodb了

[Mysql] 使用union合併兩個表 mysql合併兩個表的方法,使用union

[Mysql/MariaDB] 查看資料庫所占空間 查看資料庫在磁碟中所占空間

[Docker] Mariadb-Galera出現Incorrect definition of table mysql.column_stats:'hist_type'及 'histogram' 使用docker的Mariadb-galera出現'hist_type'及 'histogram'型別錯誤的解決方法。

[MYSQL] 把SELECT的結果UPDATE到表中 Mysql update select 出來的結果,一次完成

隨機好文

[jQuery] select 元件的取值及給值 html中的元件select,在jquery中要如何使用?

為什麼要重造輪子? 什麼輪子?造什麼輪子?我為什麼要重造輪子?

[JAVA] JWS, JWT, JWE, JOSE是什麼? [JAVA] JWS, JWT, JWE, JOSE是什麼?非常的複雜,儘量來搞清楚..

APACHE的記錄檔格式 LogFormat 語法 在APACHE中有定義一些記錄的語法模版 在 /etc/httpd/conf/httpd.conf 中: LogForm

[Wildfly10] 發佈war檔 deploy war file onto wildfly10