How To Install python3-mysql on Fedora 36

In this tutorial we learn how to install python3-mysql in Fedora 36. python3-mysql is An interface to MySQL

Introduction

In this tutorial we learn how to install python3-mysql on Fedora 36.

What is python3-mysql

Python interface to MySQL MySQLdb is an interface to the popular MySQL database server for Python. The design goals are - Compliance with Python database API version 2.0 - Thread-safety - Thread-friendliness (threads will not block each other)

We can use yum or dnf to install python3-mysql on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install python3-mysql.

Install python3-mysql on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install python3-mysql using dnf by running the following command:

sudo dnf -y install python3-mysql

Install python3-mysql on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install python3-mysql using yum by running the following command:

sudo yum -y install python3-mysql

How To Uninstall python3-mysql on Fedora 36

To uninstall only the python3-mysql package we can use the following command:

sudo dnf remove python3-mysql

python3-mysql Package Contents on Fedora 36

/usr/lib/.build-id
/usr/lib/.build-id/52
/usr/lib/.build-id/52/066f6736d3d5149b73b8b71549fec3bad0bbeb
/usr/lib64/python3.10/site-packages/MySQLdb
/usr/lib64/python3.10/site-packages/MySQLdb/__init__.py
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/__init__.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/_exceptions.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/_exceptions.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/compat.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/compat.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/connections.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/connections.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/converters.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/converters.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/cursors.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/cursors.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/release.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/release.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/times.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/__pycache__/times.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/_exceptions.py
/usr/lib64/python3.10/site-packages/MySQLdb/_mysql.cpython-310-x86_64-linux-gnu.so
/usr/lib64/python3.10/site-packages/MySQLdb/compat.py
/usr/lib64/python3.10/site-packages/MySQLdb/connections.py
/usr/lib64/python3.10/site-packages/MySQLdb/constants
/usr/lib64/python3.10/site-packages/MySQLdb/constants/CLIENT.py
/usr/lib64/python3.10/site-packages/MySQLdb/constants/CR.py
/usr/lib64/python3.10/site-packages/MySQLdb/constants/ER.py
/usr/lib64/python3.10/site-packages/MySQLdb/constants/FIELD_TYPE.py
/usr/lib64/python3.10/site-packages/MySQLdb/constants/FLAG.py
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__init__.py
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/CLIENT.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/CLIENT.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/CR.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/CR.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/ER.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/ER.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/FIELD_TYPE.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/FIELD_TYPE.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/FLAG.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/FLAG.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/constants/__pycache__/__init__.cpython-310.pyc
/usr/lib64/python3.10/site-packages/MySQLdb/converters.py
/usr/lib64/python3.10/site-packages/MySQLdb/cursors.py
/usr/lib64/python3.10/site-packages/MySQLdb/release.py
/usr/lib64/python3.10/site-packages/MySQLdb/times.py
/usr/lib64/python3.10/site-packages/mysqlclient-1.4.6-py3.10.egg-info
/usr/lib64/python3.10/site-packages/mysqlclient-1.4.6-py3.10.egg-info/PKG-INFO
/usr/lib64/python3.10/site-packages/mysqlclient-1.4.6-py3.10.egg-info/SOURCES.txt
/usr/lib64/python3.10/site-packages/mysqlclient-1.4.6-py3.10.egg-info/dependency_links.txt
/usr/lib64/python3.10/site-packages/mysqlclient-1.4.6-py3.10.egg-info/top_level.txt
/usr/share/doc/python3-mysql
/usr/share/doc/python3-mysql/FAQ.rst
/usr/share/doc/python3-mysql/MySQLdb.constants.rst
/usr/share/doc/python3-mysql/MySQLdb.rst
/usr/share/doc/python3-mysql/README.md
/usr/share/doc/python3-mysql/conf.py
/usr/share/doc/python3-mysql/index.rst
/usr/share/doc/python3-mysql/user_guide.rst
/usr/share/licenses/python3-mysql
/usr/share/licenses/python3-mysql/LICENSE

References

Summary

In this tutorial we learn how to install python3-mysql on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).