Get current user, mysql version and other status information

To get information about the currently connected user and more MySQL status information, you can call the following command if you are already logged in:

mysql> STATUS;

This will give you an output like that:

--------------
mysql  Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1

Connection id:		1044395
Current database:	
Current user:		niceguy@localhost
SSL:			Not in use
Current pager:		stdout
Using outfile:		''
Using delimiter:	;
Server version:		5.1.73-log Source distribution
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	latin1
Db     characterset:	latin1
Client characterset:	latin1
Conn.  characterset:	latin1
UNIX socket:		/var/lib/mysql/mysql.sock
Uptime:			2 days 6 hours 26 min 44 sec

Threads: 8  Questions: 399680642  Slow queries: 20292  Opens: 9697  Flush tables: 1  Open tables: 4096  Queries per second avg: 2039.145
--------------

As you can see, you got a lot more information like operation system data, MysSQL version or the number of slow queries.

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.