This Python project is a simple Library Management System that uses MySQL as the backend database. The project allows users to manage library operations such as issuing and returning books and provides an admin panel to view, edit, or delete records. .
-
Admin Panel:
- View all books issued.
- Edit issued book data.
- Delete records.
-
Student Portal:
- Issue new books.
- Return books.
- View all issued books.
-
Database Management:
- Automatic database creation and connection.
- Simple error handling for database connection and management.
- Python 3
- MySQL Server
- MySQL Connector for Python (
mysql-connector-python
)
-
Install MySQL Connector:
pip install mysql-connector-python
-
Run the Script:
python main.py
The script will prompt for the MySQL root password. Ensure your MySQL server is running locally with the default settings (host:
localhost
, user:root
). -
Database Setup:
- The script will automatically check for an existing database named
pyplm
. - If the database does not exist, it will create a new one and set up the required tables.
- The script will automatically check for an existing database named
- Admin Login: Use the default password
admin
to access the admin panel. - Student Portal: Students can issue or return books by entering their student ID and the book's UPC code.
- If the MySQL server is not installed, the script will display an error message.
- The script provides up to three attempts to input the correct MySQL root password.
- If the connection fails after three attempts, the script offers an option to manually input the MySQL connection details.