Steps to install the MySQLdb module with yum
- 2020-05-17 05:53:18
- OfStack
preface
This article mainly describes the steps to install the MySQLdb module with yum. Let's talk more about it in detail.
Complete the following steps
MySQLdb relies on the mysql-devel package, so first we need to install the mysql-devel package
1. You can download mysqldevel's rpm package from the official website and install it on the server.
2. Install MySQLdb directly with yum
yum install -y MySQLdb-python
3. Verify whether the MySQLdb module has been installed successfully
[root@ip-172-31-1-8 ~]# python
Python 2.7.10 (default, Dec 8 2015, 18:25:23)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>>
# import There is no prompt or error after that, even if MySQLdb The module package was installed successfully
conclusion
The above are all the steps of installing MySQLdb module with yum. I hope the content of this paper can bring you some help in your study or work. If you have any questions, you can leave a message to communicate.