Skip to main contentSkip to solution

Which of the following is used to install MYSQL?

Solution

✅ Correct Option: 1

pip install pymysql uses pip, Python's package installer, to install PyMySQL. This library lets Python connect to a MySQL database.


Options 2 and 4: pd.read_sql() and to_sql() are pandas functions that read from or write to a database. They do not install anything.

Option 3: sql is not the MySQL driver package, so installing it does not give Python a MySQL connection.

PyMySQL only connects Python to MySQL. The MySQL server itself is installed separately.

Keyboard Shortcuts

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