<docbook><section><title>HowDoIMonitorOpenDatabaseSessionsAssociatedWithMySQLODBCConnections</title><para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h2">How do I monitor open database sessions associated with MySQL ODBC connections?</bridgehead>
<para>Use the following steps to monitor open database sessions associated with MySQL ODBC connections:</para><para>1.
 Login to the machine that contains the MySQL instance.
2.
 su to the MySQL user.
3.
 Execute the MySQL user&#39;s .profile.
4.
 cd into the bin sub-directory of the MySQL installation.
5.
 Execute the ./mysql procedure and pass your username, password and database like so:</para><programlisting>      bash-2.03$ ./mysql -u mysql -pdba -D test
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A

      Welcome to the </programlisting><para>MySQL monitor.  Commands end with ; or \g.
 6.
 Type SHOW STATUS; (pre-5.x) or SHOW GLOBAL STATUS; (5.x) to return connection information.
 For example:</para><programlisting>      mysql&gt; SHOW STATUS
         -&gt; ;
      +--------------------------+-----------+

      Variable_name 	Value
      +--------------------------+-----------+
      Aborted_ clients 	11218
      Aborted_ connects 	26620
      Bytes_ received 	207090542
      Bytes_ sent 	767911564
      Com_ admin_ commands 	0
      Com_ alter_ table 	0
      Com_ analyze 	0
      Com_ backup_ table 	0
      Com_ begin 	0
      Com_ change_ db 	0
      Com_ change_ master 	0
      Com_ check 	0
      Com_ commit 	200
      Com_ create_ db 	0
      Com_ create_ function 	0
      Com_ create_ index 	8204
      Com_ create_ table 	11572
      Com_ delete 	333
</programlisting><para> The Threads_connected parameter shows the number of active connections.
 Consult the MySQL Reference Manual for an explanation of other variables.
</para></section></docbook>