MySQL Connectivity with Python:

Jagpreet Kaur
Aug 10, 2021

--

Now you can go to start and write python and you will see python idle present there.

Click on” python Idle “and open. You will see a window as shown below:

To, check weather our MySQL was installed properly or not we need to write “import mysql.connector” and press enter. If the code is executed successfully it means MySQL connector was installed successfully.

To, create a connection with MySQL we need to use its Username and Password which we have used while installing.

Now, let’s connect to the database using a username and password. Follow the screenshot code as displayed below.

If you want to create and see the created databases, follow the screenshot displayed below:

Hence in the end, you will be able to see all the databases present.

--

--