Computer Science, asked by kvmonty007, 6 months ago

name the module used to establish a database connection with a python
program.​

Answers

Answered by tarunvirsingh8
0

Answer:

To create a connection between the MySQL database and the python application, the connect() method of mysql.connector module is used.

Pass the database details like HostName, username, and the database password in the method call. The method returns the connection object.

Answered by devilslucifer426
0

Answer: mysql.connector

Explanation: this module perfectly works for Python-MySQL connectivity..

you can use it is

import mysql.connector as mysql

con=mysql.connect(host='localhost', user='root', password='root', database='<databasename>')

cur=con.cursor()     # cursor object

cur.execute("<any MySQL query>")

Similar questions