久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

在Linux上如何檢查MySQL/MariaDB數(shù)據(jù)庫(kù)正常運(yùn)行時(shí)間

共計(jì) 3718 個(gè)字符,預(yù)計(jì)需要花費(fèi) 10 分鐘才能閱讀完成。

自動(dòng)寫(xiě)代碼機(jī)器人,免費(fèi)開(kāi)通

這篇文章主要介紹了在 Linux 上如何檢查 MySQL/MariaDB 數(shù)據(jù)庫(kù)正常運(yùn)行時(shí)間,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓丸趣 TV 小編帶著大家一起了解一下。

方法 1:如何使用 ps 命令在 Linux 上檢查 MySQL/MariaDB 數(shù)據(jù)庫(kù)的正常運(yùn)行時(shí)間

rocess-monitoring/ >

為此,你首先需要使用 rocess-id-pid-ppid-linux/ >

# pidof mysqld | cut -d    -f1 2412

獲取 MySQL/MariaDB 的 PID 后,請(qǐng)?jiān)?ps 命令中使用 –etime 選項(xiàng)獲得正常運(yùn)行時(shí)間。

–etime:自進(jìn)程啟動(dòng)以來(lái)經(jīng)過(guò)的時(shí)間,形式為 [[DD-]hh:]mm:ss。

# ps -p 2412 -o etime ELAPSED2-08:49:30

或者,在 ps 命令中使用 –lstart 選項(xiàng)來(lái)獲取指定 PID 的正常運(yùn)行時(shí)間。

# ps -p 2412 -o lstart STARTEDSat May 2 03:02:15 2020

MySQL/MariaDB 進(jìn)程已經(jīng)運(yùn)行了 2 天 03 小時(shí) 02 分 15 秒。

方法 2:如何使用 systemctl 命令在 Linux 上檢查 MySQL/MariaDB 數(shù)據(jù)庫(kù)的正常運(yùn)行時(shí)間

systemctl 命令用于控制 systemd 系統(tǒng)和服務(wù)管理器。

systemd 是新的初始化系統(tǒng)和系統(tǒng)管理器,現(xiàn)在大多數(shù) Linux 發(fā)行版都淘汰了傳統(tǒng)的 SysVinit 管理器而采用了 systemd。

# systemctl status mariadb 或者 # systemctl status mysql ● mariadb.service - MariaDB 10.1.44 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: active (running) since Sat 2020-05-02 03:02:18 UTC; 2 days ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Process: 2448 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 2388 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ]   VAR= || VAR=/usr/bin/galera_recovery; [ $? -eq 0 ]   systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS) Process: 2386 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Main PID: 2412 (mysqld) Status:  Taking your SQL requests now hellip;  CGroup: /system.slice/mariadb.service └─2412 /usr/sbin/mysqld May 03 21:41:26 ns2.2daygeek.com mysqld[2412]: 2020-05-03 21:41:26 140328136861440 [Warning] Host name  1.1.1.1  could not be resolved:  hellip; not knownMay 04 02:00:46 ns2.2daygeek.com mysqld[2412]: 2020-05-04 2:00:46 140328436418304 [Warning] IP address  1.1.1.1  has been resolved to the host name  2 hellip;ss itself.May 04 03:01:31 ns2.2daygeek.com mysqld[2412]: 2020-05-04 3:01:31 140328436111104 [Warning] IP address  1.1.1.1  could not be resolved: Temporary fai hellip;resolutionMay 04 04:03:06 ns2.2daygeek.com mysqld[2412]: 2020-05-04 4:03:06 140328136861440 [Warning] IP address  1.1.1.1  could not be resolved: Name or ser hellip; not knownMay 04 07:23:54 ns2.2daygeek.com mysqld[2412]: 2020-05-04 7:23:54 140328435189504 [Warning] IP address  1.1.1.1  could not be resolved: Name or service not knownMay 04 08:03:31 ns2.2daygeek.com mysqld[2412]: 2020-05-04 8:03:31 140328436418304 [Warning] IP address  1.1.1.1  could not be resolved: Name or service not knownMay 04 08:25:56 ns2.2daygeek.com mysqld[2412]: 2020-05-04 8:25:56 140328135325440 [Warning] IP address  1.1.1.1  could not be resolved: Name or service not knownWarning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.Hint: Some lines were ellipsized, use -l to show in full.

方法 3:如何使用 MySQLAdmin 命令在 Linux 上檢查 MySQL/MariaDB 數(shù)據(jù)庫(kù)的正常運(yùn)行時(shí)間

MySQLAdmin 是安裝 MySQL 軟件包時(shí)安裝的 MySQL 服務(wù)器命令行程序。

MySQLAdmin 客戶(hù)端允許你在 MySQL 服務(wù)器上執(zhí)行一些基本的管理功能。

它用于創(chuàng)建數(shù)據(jù)庫(kù)、刪除數(shù)據(jù)庫(kù)、設(shè)置 root 密碼、更改 root 密碼、檢查 MySQL 狀態(tài)、驗(yàn)證 MySQL 功能、監(jiān)視 mysql 進(jìn)程以及驗(yàn)證服務(wù)器的配置。

# mysqladmin -u root -pPassword version mysqladmin Ver 8.42 Distrib 5.7.27, for Linux on x86_64Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Server version 5.7.27Protocol version 10Connection Localhost via UNIX socketUNIX socket /var/lib/mysql/mysql.sockUptime: 1 day 10 hours 44 min 13 sec

感謝你能夠認(rèn)真閱讀完這篇文章,希望丸趣 TV 小編分享的“在 Linux 上如何檢查 MySQL/MariaDB 數(shù)據(jù)庫(kù)正常運(yùn)行時(shí)間”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持丸趣 TV,關(guān)注丸趣 TV 行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!

向 AI 問(wèn)一下細(xì)節(jié)

丸趣 TV 網(wǎng) – 提供最優(yōu)質(zhì)的資源集合!

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2023-12-07發(fā)表,共計(jì)3718字。
轉(zhuǎn)載說(shuō)明:除特殊說(shuō)明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請(qǐng)注明出處。
評(píng)論(沒(méi)有評(píng)論)
主站蜘蛛池模板: 六安市| 苏尼特右旗| 青冈县| 灵台县| 宝坻区| 西畴县| 登封市| 陵水| 珠海市| 吉首市| 两当县| 上饶市| 洞头县| 乌兰县| 株洲县| 东乡| 河间市| 岳阳市| 连云港市| 桂阳县| 庐江县| 贵阳市| 阳城县| 房产| 鸡泽县| 裕民县| 彰化县| 晋城| 高要市| 贡嘎县| 家居| 瓦房店市| 金溪县| 镇康县| 铜陵市| 湘潭市| 灵寿县| 满洲里市| 庄浪县| 昌黎县| 涡阳县|