Editing
網路服務連線測試
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 檢查MySQL是否已成功啟動? === ==== 使用lsof指令 ==== {{kbd | key = lsof -i:3306}} 在{{Mac}}或{{Linux}} 在Unix類操作系統中用於列出打開的文件及打開它們的進程。 * lsof:這代表"列出打開的文件"。它是一個命令行工具,顯示有關由進程打開的文件的資訊。在Unix和Linux中,一切都被視為文件(包括硬體設備、套接字和目錄),因此lsof是系統管理員監控和排除系統行為問題的強大工具。 * -i:這個選項告訴lsof僅顯示網絡文件。在Unix和Linux中,網絡連接被視為文件。-i選項可用於根據互聯網地址或網絡協議過濾連接。 * :3306:這指定了埠號。埠3306通常被MySQL使用,這是一個流行的數據庫管理系統。通過包括:3306,您要求lsof列出所有與埠3306相關的網絡文件(包括套接字連接)。 輸出範例:localhost:mysql (LISTEN) 意味著MySQL已成功啟動 <pre> COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mysqld 93034 account 29u IPv4 0xxxx 0t0 TCP localhost:mysql (LISTEN) </pre> ==== 使用ps指令 ==== {{kbd | key = <nowiki>ps aux | grep mysql</nowiki>}} 在{{Mac}} 如果MySQL已成功啟動的輸出範例: <pre> _mysql 11083 0.3 0.2 409657280 31424 ?? Ss 2:12下午 0:01.07 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/mysqld.local.err --pid-file=/usr/local/mysql/data/mysqld.local.pid --keyring-file-data=/usr/local/mysql/keyring/keyring --early-plugin-load=keyring_file=keyring_file.so ACCOUNT 12349 0.0 0.0 408645328 1648 s011 S+ 2:14下午 0:00.00 grep mysql </pre> 如果MySQL沒有成功啟動的示例輸出: <pre> ACCOUNT 12349 0.0 0.0 408645328 1648 s011 S+ 2:14下午 0:00.00 grep mysql </pre>
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information