开发者

How to get mysql server info using command line?

开发者 https://www.devze.com 2023-01-19 22:17 出处:网络
Is there a direct command line command that provides all mysql server information like below...This is provided using Mysql GUI administrator. Do we have some direct command to get this infoussing com

Is there a direct command line command that provides all mysql server information like below...This is provided using Mysql GUI administrator. Do we have some direct command to get this info ussing command line ?

开发者_开发问答

Username:

Hostname:

Port:

Server Information

MySQL Version:

Network Name:

IP:

Client Information

Version:

Network name:

IP:

Operating System:

Hardware:


Look at following MySQL documentation:

SHOW VARIABLES

Following command will show you most of your desired information:

SHOW VARIABLES;

Only version:

select version();

EDIT:

What is the difference between show variables and show status?

SHOW STATUS provides server status information like Connections, Opened_tables, Bytes_received, Bytes_sent, etc.

More Info

SHOW VARIABLES shows the values of MySQL system variables like time_zone, version, max_connections, etc.

More Info


Try just status:

mysql> status
--------------
mysql  Ver 14.14 Distrib 5.5.33, for osx10.7 (i386) using readline 5.1

Connection id:      3
Current database:   somedb
Current user:       someuser@localhost
SSL:            Not in use
Current pager:      stdout
Using outfile:      ''
Using delimiter:    ;
Server version:     5.5.33 Source distribution
Protocol version:   10
Connection:     127.0.0.1 via TCP/IP
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
TCP port:       3306
Uptime:         38 min 53 sec

Threads: 2  Questions: 196  Slow queries: 0  Opens: 87  Flush tables: 1  Open tables: 80  Queries per second avg: 0.084
--------------
0

精彩评论

暂无评论...
验证码 换一张
取 消