Skip to content

MySQL Monitor implemented in Python. Project of IS214: Database Theory.

Notifications You must be signed in to change notification settings

Bowen-n/MySQL_Monitor

Repository files navigation

MySQL Monitor in Python

😄This is my project for IS214:Database Theory in SJTU. I develop a log monitor and status monitor for MySQL Database with python. For log monitor, I referred to repo MySQLMonitor. Based on that, I added a status monitor to this project.

Preparation

  1. Install MySQL. A guideline for installing can be found here.

  2. Install PyMySQL using pip install pymysql in your terminal. If you install pymysql successfully, you can run pymysql_demo.py to take a peek of pymysql. Don't forget to change the parameters in line 3 and SQL command in line 11.

Structure

  1. In monitor.py, both log monitor(function) and status monitor(class) are defined.
  2. utils.py offers functions to connect MySQL database and execute SQL commands.
  3. Both main_logmonitor.py and main_statusmonitor.py are the running file.

How to Use

  1. Open file config.ini . Usually you only need to change passward and db_name to your own in this file.

  2. Run main_logmonitor.py to start Log Monitor. It can monitor the commands used by all users of the database in real time. The output is shown as follow:

log monitor

  1. Run main_statusmonitor.py to start Status Monitor. It can monitor the status like using tables, threads, connection list of the database in real time. The output is shown as follow:

status monitor

Hope you have fun ☺️

About

MySQL Monitor implemented in Python. Project of IS214: Database Theory.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages