檢查MYSQL資料中的表是否都正常

2021-09-20 19:44:08 字數 585 閱讀 4695

"mysqlcheck"命令是mysql自帶的一條命令,我們可以通過它檢查資料庫中的表是否正常。

一、檢查一張表

#

mysqlcheck 資料庫 表名 -uroot -p"password"

二、檢查乙個資料庫下的所有表

#

mysqlcheck 資料庫 -uroot -p"password"

三、檢查所有資料庫下的所有表

#

mysqlcheck -a -uroot -p"password"

四、修復一張表

#

mysqlcheck --auto-repair 資料庫 表名 -uroot -p"password"

五、修復乙個資料庫下所有表

#

mysqlcheck --auto-repair 資料庫 -uroot -p"password"

檢查mysql資料庫是否存在壞表指令碼

1 bin bash 2 此指令碼的主要用途是檢測mysql伺服器上所有的db或者單獨db中的壞表 3 變數說明 pass mysql賬戶口令 name mysql賬號名稱 data path mysql目錄路徑 directory list 目錄列表 file list檔案列表 db name 資...

檢查單鍊錶中是否有環

用兩個指標,從頭節點開始遍歷,乙個指標a每次走1步,乙個指標b每次都2步。如果有環,兩個指標相遇前 b位於a後一位時,那麼a,b指標下次相遇。b位於a後兩位時,那麼a,b指標下下次即將相遇。建立鍊錶 public static node createlist int max return first...

表間資料是否一致的檢查 資料比對

資料庫 twt001 資料表 a,b 參考文章 sql中的case when用法 sql中的case when用法 case函式不同於decode函式。在case函式中,可以使用between,like,is null,in,exists等等。比如說使用in,exists,可以進行子查詢,從而實現更...