I would like to check the numbers of MySQL open database connection on my linux system. How Do I get the number information of my sql open database connections under linux operating system. this post will guide you how to check the number of mysql open database connections.
You can use the following ways to check the number of my sql open database connections.
1. using mysqladmin status command
you can issue the following mysqladmin command to get the number of mysql open database connections, type:
mysqladmin status
or
mysqladmin status -u root -p (here you need to input the mysql password for root user)
2. using MySQL show status command to check the number of mysql open database connections.
Firstly, you need to login the mysql server by issue the following command:
mysql -u root -pu
Then running the below mysql command, you will get the connection information for open database,type:
show status like 'Conn%';
3. using netstat command to check open database connection for mysql
You can run the following netstat command passing “-na” option and it will list all of network connections in the current system, then you combine with “grep” command to filter all mysql connections, type:
netstat -na | grep *3306
where, 3306 is the default port number of MySQL server.
done..