刪除所有的binlog後mysql 啟動不了,檢視錯誤日誌,原來是找不到日誌檔案了,
2018-08-17t06:58:33.935452z 0 [note] plugin 'federated' is disabled.
mysqld: file './mysql-bin.000474' not found (errcode: 2 - no such file or directory)
2018-08-17t06:58:33.937608z 0 [error] failed to open log (file './mysql-bin.000474', errno 2)
2018-08-17t06:58:33.937619z 0 [error] could not open log file
2018-08-17t06:58:33.937627z 0 [error] can't init tc log
2018-08-17t06:58:33.937633z 0 [error] aborting
不考慮丟資料的情況,可以使用下面的方法啟動資料庫:將mysql-bin.index 內容清空,
啟動資料庫,這是資料庫會重置日誌檔案,從01開始。
刪除所有的使用者表
1 刪除表的外來鍵約束 create procedure sp drop all fk as declare sql varchar 255 declare dropsql cursor cursor for select alter table object name fkeyid drop co...
sqlserver刪除所有的使用者表
create procedure dbo.deletetable as declare name as nvarchar 128 declare curobject cursor for select name from sysobjects where type u and name like p...
redis 模糊刪除所有的快取資訊
iteratorit jedis.keys rediskey iterator while it.hasnext 下面這句是查詢所有已 rediskey開頭的快取名稱 如 rediskey 456 這種都會被搜尋出來 比較消耗系統效能 iteratorit jedis.keys rediskey i...