Skip to main contentSkip to solution

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.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question