Skip to content

This repository contains source codes to connect MySQL with python and perform various functions as described in the readme file of each folder

License

Notifications You must be signed in to change notification settings

dhananjay-m-r/python-mysql

Repository files navigation

About this Repository

This repository contains program which establishes connection to MySQL from python.

The programs in this repository are capable of doing various functions & a glimpse over their functions and use is given in the readme file of the respective directory where the source code is present.

»»——————---——————-««

The repository contains a total of 3 main directories:

1 -> Basic Connection Establishment Program

2 -> Create & Drop

3 -> Module Check

»»——————---——————-««

About the directory 1 -> Basic Connection Establishment Program

The directory contains the source codes for the following programs:

-> 1_Connection Establishment without Error Handling.py

-> 2_Connection Establishment with error handling.py

-> 3_Connection Establishment with error handling & User Input

»»——————---——————-««

Aboout Program -> 1_Connection Establishment without Error Handling.py

The source code for this program is to check whether your python program is able to establish connection with MySQL Database.

Note: 

-> This source code doesn't come with error handling. For source code with error handling kindly check the other program in the directory

-> Details such as HostID, User ID & Password are predefined, therefore kindly tune the source code using a editor according to your settings to establish the connection.

»»——————---——————-««

About Program -> 2_Connection Establishment with error handling.py

Unlike the previous program, this program comes with error handling therefore you wont get a runtime error with a dozens of lines of errors on your screen.

But Again, details such as HostID, User ID & Password are predefined, therefore kindly tune the source code using a editor according to your settings to establish the connection.

»»——————---——————-««

About Program -> 3_Connection Establishment with error handling & User Input

The source code for this program includes the feature of both the previous files, but in addition to that, in this program you dont have to predefine the details such as HostID, User ID & Password as those details will be asked by the user for the input for respective details during runtime.

About the directory 2 -> Create & Drop

This directory contains a subdirectory named:

-> Databases

The subdirectory Databases has the source codes for the following programs:

1 -> Create Databases_Loop Enabled.py

2 -> Create and view list of existing database.py

3 -> Drop Databases with loop.py

4 -> View List of MySQL DB.py

5 -> View and drop existing databases.py

»»——————---——————-««

About Program 1 -> Create Databases_Loop Enabled.py

The source code for the program allows the user to view the list of available databases on the server & create databases.

The source code also comes with the loop function which the user can terminate until the required number of databases are created.

»»——————---——————-««

About Program 2 -> Create and view list of existing database.py

The source code for the program does the same work as mentioned in the description of program 1, except for the loop part.

The users who do not require the loop function, may use this program, while the ones who need loop function may use the program 1.

About Program 3 -> Drop Databases with loop.py

The source code for the program allows the user to view the list of available databases on the server & drop them.

The source code also comes with the loop function which the user can terminate until the required number of databases are deleted.

Disclaimer: Once a database is dropped, it cannot be retrieved back

»»——————---——————-««

About Program 3 -> Drop Databases with loop.py

The source code for the program allows the user to view the list of available databases on the server & drop them.

The source code also comes with the loop function which the user can terminate until the required number of databases are deleted.

Disclaimer: Once a database is dropped, it cannot be retrieved back

»»——————---——————-««

About Program 4 -> View List of MySQL DB.py

The codes for this program retrieves the names of the MySQL Databases which has been created on your server.

Together it also shows the total number of MySQL Databases existing on your server.

Unfortunately this program is not available with the loop function due to small bug in it. Once fixed, the source code will be updated.

»»——————---——————-««

About Program 5 -> View and drop existing databases.py

Unlike the Program 3, this program doesnt come with loop function. But does the same work as Program 3

The users who do not require the loop function, may use this program, while the ones who need loop function may use the program 1.

About the directory 3 -> Module Check

This directory contains the Source code for the program which checks and lets you know whether the required module for MySQL python connectivity is installed on your device.

If the module is not installed kindly install the module

There are various videos on youtube which gives you step by step procedure to install the required module to establish connection between MySQL and python.

»»———--Important Note: --———-««

-> The server details such as Host ID, User ID & Password has to be given by the user as input during runtime.

»»——————---——————-««

Repository by: Dhananjay M.R

About

This repository contains source codes to connect MySQL with python and perform various functions as described in the readme file of each folder

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages