- Python Data Access Tutorial
- Python MySQL
- Python PostgreSQL
- Python SQLite
- Python MongoDB
- Python Data Access Resources
MySQL Connector/Python supports almost all features provided by MySQL version 5.7. It allows you to convert the parameter’s value between Python and MySQL data types e.g., Python datetime and MySQL DATETIME. MySQL Connector/Python is designed specifically to MySQL. MySQL Connector/Python is a standardized database driver for Python platforms and development. Additionally, MySQL Connector/Python 8.0 supports the new X DevAPI for development with MySQL. Pip install mysql-connector For Python 3 or higher version install using pip3 as: pip3 install mysql-connector Test the MySQL Database connection with Python. To test database connection here we use pre-installed MySQL connector and pass credentials into. MySQL driver written in Python which does not depend on MySQL C client libraries and implements the DB API v2.0 specification (PEP-249).
- Selected Reading
When you have divided the data in two tables you can fetch combined records from these two tables using Joins.
Example
Suppose we have created a table with name EMPLOYEE and populated data into it as shown below −
Then, if we have created another table and populated it as −
Following statement retrieves data combining the values in these two tables −
MYSQL JOIN using python
Pip Install Mysql Connector Python
Following example retrieves data from the above two tables combined by contact column of the EMPLOYEE table and ID column of the CONTACT table.