CBSE Class 12 Computer Science Question 24 of 46

Interface Python with MySQL — Question 1

Back to all questions
1
Question

Question 1

In order to open a connection with MySQL database from within Python using mysql.connector package, ............... function is used.

  1. open()
  2. database()
  3. connect()
  4. connectdb()
Answer

connect()

Reason — The connect() function of mysql.connector is used for establishing connection to a MYSQL database.