新聞中心
寶塔面板是一種基于 Linux 的網(wǎng)站管理面板,它是服務(wù)器管理者的得力助手,通過寶塔面板可以方便地完成網(wǎng)站環(huán)境部署、數(shù)據(jù)庫操作、文件管理等一系列任務(wù)。它的優(yōu)點(diǎn)是配合簡單、使用方便,使得網(wǎng)站搭建成為易如反掌的事情。

創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)與策劃設(shè)計(jì),洛扎網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:洛扎等地區(qū)。洛扎做網(wǎng)站價(jià)格咨詢:028-86922220
不過,盡管寶塔面板的方便性是無可厚非的,但在使用中也會(huì)遇到一些問題,即便是一些看上去平常的操作也需要注意,特別是操作數(shù)據(jù)庫時(shí)。其中一個(gè)常見問題是,在進(jìn)行數(shù)據(jù)庫清空操作后,可能無法啟動(dòng)寶塔面板,這時(shí)該怎么辦呢?
1. 先查看寶塔面板是否已經(jīng)啟動(dòng)。
如果無法訪問寶塔面板,首先需要確認(rèn)的是面板是否已經(jīng)啟動(dòng)??梢允褂妹钚型ㄟ^以下命令檢查面板是否啟動(dòng):
“`
systemctl status bt
“`
如果寶塔面板未啟動(dòng),需要使用以下命令啟動(dòng)面板:
“`
systemctl start bt
“`
需要注意的是,如果使用了Nginx或Apache作為網(wǎng)站服務(wù)器,還需要確認(rèn)Nginx或Apache是否已經(jīng)啟動(dòng)。
2. 檢查 MySQL 服務(wù)是否正常。
MySQL 是寶塔面板使用的數(shù)據(jù)庫,如果該服務(wù)未正常運(yùn)行,寶塔面板也無法啟動(dòng)。可以通過命令行檢查 MySQL 服務(wù)的狀態(tài):
“`
systemctl status mysql
“`
如果服務(wù)未正常運(yùn)行,可以使用以下命令強(qiáng)制啟動(dòng) MySQL:
“`
systemctl start mysql –force
“`
3. 檢查是否存在針對 MySQL 文件的操作。
有些情況下,可能是對 MySQL 數(shù)據(jù)庫文件進(jìn)行了意外的操作,比如清空了 MySQL 數(shù)據(jù)庫的 binlog,這時(shí)候也會(huì)導(dǎo)致寶塔面板無法啟動(dòng)。在這種情況下,需要檢查 MySQL 數(shù)據(jù)庫的 binlog 是否存在,如果被清空,需要通過以下命令重建 binlog:
“`
mysql -u root -p
FLUSH TABLES WITH READ LOCK;
SET GLOBAL innodb_fast_shutdown=0;
SET GLOBAL innodb_flush_log_at_trx_commit=0;
exit
cd /www/server/data/
cp -rp mysql mysql_backup
rm -fR mysql/*
mysql_install_db –user=mysql –basedir=/usr –datadir=/www/server/data/mysql
“`
4. 檢查程序文件是否受到修改或污染。
在使用寶塔面板時(shí),機(jī)器上的環(huán)境變量、配置文件等都會(huì)受到一定的限制。但是,如果機(jī)器的一些配置文件或環(huán)境變量被修改了,也有可能導(dǎo)致寶塔面板啟動(dòng)失敗。這種情況下,可以嘗試使用以下命令修復(fù)程序文件:
“`
bt cleanup && bt update
“`
在進(jìn)行這些操作時(shí),需要注意備份的重要性,以防操作錯(cuò)誤導(dǎo)致數(shù)據(jù)丟失。此外,在處理寶塔面板啟動(dòng)失敗事件時(shí),也需要查看相關(guān)日志信息,通過查看日志可以更準(zhǔn)確地定位問題和解決。
:寶塔數(shù)據(jù)庫清空日志引起無法啟動(dòng)的問題,可能是多種原因?qū)е碌摹R虼?,在使用寶塔面板的過程中,一定要謹(jǐn)慎操作,做好備份工作,同時(shí)也要隨時(shí)注意查看機(jī)器狀態(tài)和相關(guān)日志信息,以便及時(shí)發(fā)現(xiàn)并解決問題。
相關(guān)問題拓展閱讀:
- mysql服務(wù)啟動(dòng)不了,下面是mysql的錯(cuò)誤日志
mysql服務(wù)啟動(dòng)不了,下面是mysql的錯(cuò)誤日志
1、注意存儲(chǔ)引擎錯(cuò)誤
Unknown/unsupported storage engine: InnoDB
2、空姿檢查一下
配置文件
中關(guān)于innodb的參數(shù),如果斗嫌絕有skip-innodb注釋掉
3、如果重新設(shè)置了innodb_log_file_size之類者握的,需要?jiǎng)h除幾個(gè)ib_logfile,然后重啟數(shù)據(jù)庫
刪除data目族蘆肢錄下ib_logfile開頭的日兆世志文嘩孝件,重啟好了。
我的是MariaDB 5.5。
Unknown/神舉前unsupported storage engine: InnoDB
不支持innodb 你看看 配置答信文件中的游清innodb ?
裝了一個(gè)OA管理軟件,管理有數(shù)據(jù)安裝,當(dāng)時(shí)沒注意,塌鄭滑結(jié)果在用MySQL的時(shí)候,無法啟動(dòng)服務(wù),感覺就是當(dāng)時(shí)安裝了這個(gè)OA管理軟件的數(shù)據(jù)庫的錯(cuò)吧
卸載軟件MySQL
注冊表清理MySQL
復(fù)制保留data文件下面的幾個(gè)庫到桌面,刪除C盤的MySQL,
然團(tuán)臘后就開始叢前安裝吧,應(yīng)該不會(huì)報(bào)錯(cuò)了,然后在把放在桌面上的庫放到MySQL庫里面去
MySQL 8.0 重新定義了錯(cuò)誤日志輸出和過濾,改善了原來臃腫并且可讀性很差的錯(cuò)誤日志。比如增加了 ON 輸出,在原來的日志后面以序號(hào)以及 ON 后綴的方式展示。比如我機(jī)器上的 MySQL 以 ON 保存的錯(cuò)誤日志 mysqld.log.00.json:# jq . mysqld.log.00.json{ “l(fā)og_type”: 1, “prio”: 1, “err_code”: 12592, “subsystem”: “InnoDB”模碧侍, “msg”: “Operating system error number 2 in a file operation.”, “time”: “T08:16:12.111808Z”, “thread”: 8, “err_symbol”: “ER_IB_MSG_767”, “SQL_state”: “HY000”, “l(fā)abel”: “Error”}{ “l(fā)og_type”: 1, “prio”: 1, “err_code”: 12593, “subsystem”: “InnoDB”, “msg”: “The error means the system cannot find the path specified.”, “time”: “T08:16:12.111915Z”, “thread”: 8, “err_symbol”: “ER_IB_MSG_768”, “SQL_state”: “HY000”, “l(fā)abel”: “Error”}{ “l(fā)og_type”: 1, “prio”: 1, “err_code”: 12216, “subsystem”: “InnoDB”, “msg”: “Cannot open datafile for read-only: ‘./ytt2/a.ibd’ OS error: 71”, “time”: “T08:16:12.111933Z”, “thread”旦吵: 8, “err_symbol”: “ER_IB_MSG_391”, “SQL_state”: “HY000”, “l(fā)abel”: “Error”}以 ON 輸出錯(cuò)誤日志后可讀性和可操作性增強(qiáng)了許多。這里可以慧嘩用 Linux 命令 jq 或者把這個(gè)字串 COPY 到其他解析 ON 的工具方便處理。只想非??焖俚哪贸鲥e(cuò)誤信息,忽略其他信息。# jq ‘.msg’ mysqld.log.00.json”O(jiān)perating system error number 2 in a file operation.””The error means the system cannot find the path specified.””Cannot open datafile for read-only: ‘./ytt2/a.ibd’ OS error: 71″”Cannot calculate statistics for table `ytt2`.`a` because the .ibd file is missing. Please refer to for how to resolve the issue.””Cannot calculate statistics for table `ytt2`.`a` because the .ibd file is missing. Please refer to for how to resolve the issue.”使用 ON 輸出的前提是安裝 ON 輸出部件。
INSTALL COMPONENT ‘
完了在設(shè)置變量 SET GLOBAL log_error_services = ‘log_filter_internal; log_sink_json’;
格式為:過濾規(guī)則;日志輸出;日志輸出;查看安裝好的部件mysql> select * from mysql.component;++——++| component_id | component_group_id | component_urn|++——++|| 1 ||++——++3 rows in set (0.00 sec)
現(xiàn)在設(shè)置 ON 輸出,輸出到系統(tǒng)日志的同時(shí)輸出到 ON 格式日志。mysql> SET persist log_error_services = ‘log_filter_internal; log_sink_internal; log_sink_json’;Query OK, 0 rows affected (0.00 sec)
來測試一把。我之前已經(jīng)把表 a 物理文件刪掉了。mysql> select * from a;ERROR 1812 (HY000): Tablespace is missing for table `ytt2`.`a`.
現(xiàn)在錯(cuò)誤日志里有 5 條記錄。
# tailf mysqld.log
T08:16:12.111808Z 8 Operating system error number 2 in a file operation.
T08:16:12.111915Z 8 The error means the system cannot find the path specified.
T08:16:12.111933Z 8 Cannot open datafile for read-only: ‘./ytt2/a.ibd’ OS error: 71
T08:16:12.112227Z 8 Cannot calculate statistics for table `ytt2`.`a` because the .ibd file is missing. Please refer to for how to resolve the issue.
T08:16:14.902617Z 8 Cannot calculate statistics for table `ytt2`.`a` because the .ibd file is missing. Please refer to for how to resolve the issue.
ON 日志里也有 5 條記錄。
# tailf mysqld.log.00.json
{ “l(fā)og_type” : 1, “prio” : 1, “err_code” : 12592, “subsystem” : “InnoDB”, “msg” : “Operating system error number 2 in a file operation.”, “time” : “T08:16:12.111808Z”, “thread” : 8, “err_symbol” : “ER_IB_MSG_767”, “SQL_state” : “HY000”, “l(fā)abel” : “Error” }
{ “l(fā)og_type” : 1, “prio” : 1, “err_code” : 12593, “subsystem” : “InnoDB”, “msg” : “The error means the system cannot find the path specified.”, “time” : “T08:16:12.111915Z”, “thread” : 8, “err_symbol” : “ER_IB_MSG_768”, “SQL_state” : “HY000”, “l(fā)abel” : “Error” }
{ “l(fā)og_type” : 1, “prio” : 1, “err_code” : 12216, “subsystem” : “InnoDB”, “msg” : “Cannot open datafile for read-only: ‘./ytt2/a.ibd’ OS error: 71”, “time” : “T08:16:12.111933Z”, “thread” : 8, “err_symbol” : “ER_IB_MSG_391”, “SQL_state” : “HY000”, “l(fā)abel” : “Error” }
{ “l(fā)og_type” : 1, “prio” : 2, “err_code” : 12023, “subsystem” : “InnoDB”, “msg” : “Cannot calculate statistics for table `ytt2`.`a` because the .ibd file is missing. Please refer to for how to resolve the issue.”, “time” : “T08:16:12.112227Z”, “thread” : 8, “err_symbol” : “ER_IB_MSG_224”, “SQL_state” : “HY000”, “l(fā)abel” : “Warning” }
{ “l(fā)og_type” : 1, “prio” : 2, “err_code” : 12023, “subsystem” : “InnoDB”, “msg” : “Cannot calculate statistics for table `ytt2`.`a` because the .ibd file is missing. Please refer to for how to resolve the issue.”, “time” : “T08:16:14.902617Z”, “thread” : 8, “err_symbol” : “ER_IB_MSG_224”, “SQL_state” : “HY000”, “l(fā)abel” : “Warning” }
那可能有人就問了,這有啥意義呢?只是把格式變了,過濾的規(guī)則我看還是沒變。那我們現(xiàn)在給第二條日志輸出加過濾規(guī)則先把過濾日志的部件安裝起來
INSTALL COMPONENT ‘
mysql> SET persist log_error_services = ‘log_filter_internal; log_sink_internal; log_filter_dragnet;log_sink_json’;
Query OK, 0 rows affected (0.00 sec)
只保留 error,其余的一律過濾掉。SET GLOBAL dragnet.log_error_filter_rules = ‘IF prio>=WARNING THEN drop.’;
檢索一張誤刪的表mysql> select * from a;ERROR 1812 (HY000): Tablespace is missing for table `ytt2`.`a`.
查看錯(cuò)誤日志和 ON 錯(cuò)誤日志發(fā)現(xiàn)錯(cuò)誤日志里有一條 Warning,ON 錯(cuò)誤日志里的被過濾掉了。T08:22:32.978728Z 8 Cannot calculate statistics for table `ytt2`.`a` because the .ibd file is missing. Please refer to for how to resolve the issue.
再舉個(gè)例子,每 60 秒只允許記錄一個(gè) Warning 事件mysql> SET GLOBAL dragnet.log_error_filter_rules = ‘IF prio==WARNING THEN throttle 1/60.’;Query OK, 0 rows affected (0.00 sec)
多次執(zhí)行mysql> select * from b;ERROR 1812 (HY000): Tablespace is missing for table `ytt2`.`b`.mysql> select * from b;ERROR 1812 (HY000): Tablespace is missing for table `ytt2`.`b`.mysql> select * from b;ERROR 1812 (HY000): Tablespace is missing for table `ytt2`.`b`.
現(xiàn)在錯(cuò)誤日志里有三條 warning 信息
T08:49:06.820235Z 8 Cannot calculate statistics for table `ytt2`.`b` because the .ibd file is missing. Please refer to for how to resolve the issue.
T08:49:31.455907Z 8 Cannot calculate statistics for table `ytt2`.`b` because the .ibd file is missing. Please refer to for how to resolve the issue.
T08:50:00.430867Z 8 Cannot calculate statistics for table `ytt2`.`b` because the .ibd file is missing. Please refer to for how to resolve the issue.
mysqld.log.00.json 只有一條{ “l(fā)og_type” : 1, “prio” : 2, “err_code” : 12023, “subsystem” : “InnoDB”, “msg” : “Cannot calculate statistics for table `ytt2`.`b` because the .ibd file is missing. Please refer to for how to resolve the issue.”, “time” : “T08:49:06.820235Z”, “thread” : 8, “err_symbol” : “ER_IB_MSG_224”, “SQL_state” : “HY000”, “and_n_more” : 3, “l(fā)abel” : “Warning” }
總結(jié),我這里簡單介紹了下 MySQL 8.0 的錯(cuò)誤日志過濾以及 ON 輸出。MySQL 8.0 的component_log_filter_dragnet 部件過濾規(guī)則非常靈活,可以參考手冊,根據(jù)它提供的語法寫出自己的過濾掉的日志輸出。
寶塔清空數(shù)據(jù)庫日志無法啟動(dòng)的介紹就聊到這里吧,感謝你花時(shí)間閱讀本站內(nèi)容,更多關(guān)于寶塔清空數(shù)據(jù)庫日志無法啟動(dòng),寶塔數(shù)據(jù)庫清空日志引起無法啟動(dòng),如何解決?,mysql服務(wù)啟動(dòng)不了,下面是mysql的錯(cuò)誤日志的信息別忘了在本站進(jìn)行查找喔。
香港服務(wù)器選創(chuàng)新互聯(lián),2H2G首月10元開通。
創(chuàng)新互聯(lián)(www.cdcxhl.com)互聯(lián)網(wǎng)服務(wù)提供商,擁有超過10年的服務(wù)器租用、服務(wù)器托管、云服務(wù)器、虛擬主機(jī)、網(wǎng)站系統(tǒng)開發(fā)經(jīng)驗(yàn)。專業(yè)提供云主機(jī)、虛擬主機(jī)、域名注冊、VPS主機(jī)、云服務(wù)器、香港云服務(wù)器、免備案服務(wù)器等。
網(wǎng)頁名稱:寶塔數(shù)據(jù)庫清空日志引起無法啟動(dòng),如何解決?(寶塔清空數(shù)據(jù)庫日志無法啟動(dòng))
轉(zhuǎn)載來源:http://www.dlmjj.cn/article/cdsehed.html


咨詢
建站咨詢
