To establish a connection between Python and SQL database,
connect()
is used. Which of the following arguments may not necessarily be given while calling
connect()
?
(a)
host
(b)
database
(c)
user
(d)
password
Answer:
To create a connection between the MySQL database and python application, the connect( ) function is used. The functions requires 4 parameters:
- Hostname
- Username
- Password
- Database name
Among the 4 parameters, database name is not a mandatory parameter.
So, the correct answer is (b) database.