Which of the following library is used to interact with the MySQL database by providing the required credentials?
Which of the following library is used to interact with the MySQL database by providing the required credentials?
Solution
✅ Correct Option: 1
SQLAlchemy is the Python library used to connect to databases such as MySQL. The credentials go into a connection URL, for example mysql+pymysql://user:password@host/dbname, which is then used to create the connection.
Option 2: create_engine is a function inside sqlalchemy that takes the credentials URL, not a library itself.
Option 3: mysqldb is only a low-level MySQL driver that sqlalchemy can use in the background.
Related questions:
2025: 16 May Shift 1
2025: 15 May Shift 2
2025: 3 June Shift 2
2025: 22 May Shift 1