Connect to utf8mb4 database from python

Introduction

I used the PyMySQL3 driver from python to access the utf8mb4 pre-configured database. Then, KeyError: 45 error occurred, so instead, [mysql-connector-python-rf](https://pypi.python.org/pypi/mysql-connector-python-rf] provided by the MySQL official ) I used the driver, but there was a minor problem at that time, so I will record it as a reminder.

environment

Version
OS
python
pip
mysql-connector-python-rf
PyMySQL3 (reference)

procedure

First, I ran the following command to install the driver.

pip install mysql-connector-python-rf

However,

Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/j2/8h3wfb391t1_58crtwyc1xx00000gp/T/pip-build-6oqq9ezx/mysql-connector-python-rf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/j2/8h3wfb391t1_58crtwyc1xx00000gp/T/pip-hwj0p9pe-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/j2/8h3wfb391t1_58crtwyc1xx00000gp/T/pip-build-6oqq9ezx/mysql-connector-python-rf/

Error occurred and the installation could not be performed. As a result of various investigations

pip install --egg mysql-connector-python-rf

The installation was successful by adding the --egg option. With this driver, you can operate the utf8mb4 database without any problems.

Finally

During the installation, the warning DEPRECATION: --egg has been deprecated and will be removed in the future . was displayed, so it may not be usable anytime soon.

Recommended Posts

Connect to utf8mb4 database from python
Connect to sqlite from python
Connect to coincheck's Websocket API from Python
Changes from Python 3.0 to Python 3.5
Changes from Python 2 to Python 3.0
Connect python to mysql
Use Tor to connect from urllib2 [Python] [Mac]
Connect to BigQuery with Python
Post from Python to Slack
Connect to Wikipedia with Python
Anaconda updated from 4.2.0 to 4.3.0 (python3.5 updated to python3.6)
Switch from python2.7 to python3.6 (centos7)
Call Matlab from Python to optimize
Try IAM Database Authentication from Python
Create folders from '01' to '12' with python
Post from python to facebook timeline
[Lambda] [Python] Post to Twitter from Lambda!
How to connect to various DBs from Python (PEP 249) and SQLAlchemy
[Day3] Preparing to connect to the database
Python (from first time to execution)
Post images from Python to Tumblr
Ssh connect to GCP from Windows
How to access wikipedia from python
Python to switch from another language
Did not change from Python 2 to 3
Update Python on Mac from 2 to 3
How to connect to Cloud Firestore from Google Cloud Functions with python code
Connect to Packetix VPN from CentOS 7 minimal.
Connect to Docker's MySQL container from Flask
How to update Google Sheets from Python
Send a message from Python to Slack
Private Python handbook (updated from time to time)
I want to use jar from python
Connect to MySQL with Python within Docker
Convert from katakana to vowel kana [python]
Push notification from Python server to Android
Connecting from python to MySQL on CentOS 6.4
Porting and modifying doublet-solver from python2 to python3.
How to access RDS from Lambda (python)
Python> Output numbers from 1 to 100, 501 to 600> For csv
Connect to s3 with AWS Lambda Python
[Python / Tkinter] Connect keyboard shortcuts to Menu
Connect to pepper with PEPPER Mac's python interpreter
Convert from Markdown to HTML in Python
[Amazon Linux] Switching from Python 2 series to Python 3 series
API explanation to touch mastodon from python
Updated to Python 2.7.9
Sum from 1 to 10
sql from python
Connect to postgreSQL from Python and use stored procedures in a loop.
MeCab from Python
Connect your SQL Server database to Alibaba Cloud Function Compute using Python
Connect to mysql
"Backport" to python 2
Send a message from Slack to a Python server
Edit Excel from Python to create a PivotTable
How to open a web browser from python
Study from Python Hour7: How to use classes
[Python] Convert from DICOM to PNG or CSV
Import Excel file from Python (register to DB)
I want to email from Gmail using Python.