Installing and connecting to a MySQL server from PythonÂ
Before we can connect to a MySQL database, we have to connect to the MySQL Server. In order to do this, we need to know the IP address of the MySQL server as well as the port it is listening on.
We also have to be a registered user with a password in order to get authenticated by the MySQL server.
Getting ready
You will need to have access to a running MySQL Server instance and you also need to have administrator privileges in order to create databases and tables.Â
There is a free MySQL Community Edition available from the official MySQL website. You can download and install it on your local PC from http://dev.mysql.com/downloads/windows/installer/5.7.html:
During the installation process, you will choose a password for the Root user, and you can also add more users. I recommend you add yourself as a DB Admin and choose a password as well:
Note
In this chapter, we are using the latest MySQL Community Server Release 5.7.17.
Â
How to do it…
In...