This section will cover MySQL database administration using Python. You already know Python has various modules for mysql database administration. So, we will learn about the MySQLdb module here. The mysqldb module is an interface for MySQL database server and is used to provide Python database API.
Let's learn how to install MySQL and a Python mysqldb package. For this, run the following command in your Terminal:
$ sudo apt install mysql-server
This command installs the MySQL server and various other packages. While installing the package, we are prompted to enter a password for the MySQL root account:
- The following code is used for checking for the mysqldb package to install:
$ apt-cache search MySQLdb
- And the following is for installing the Python interface for MySQL:
$ sudo apt-get install python3-mysqldb
- Now, we will check if mysql...