Where exactly should I put the unzipped MySQL-python-1.2. Check the output of setup.py, it will tell you. Also, if you have a 64-bit machine, the mysql package might end up in /usr/lib64/.
#Mysqldb python 3 install install#
# execute SQL query using execute() method. I confirmed this on Fedora 17, though I needed to install python-devel and mysql-devel before it would work.
# prepare a cursor object using cursor() method $ # The folder PyMySQL* can be safely removed now.įollowing is an example of connecting with MySQL database "TESTDB" − #!/usr/bin/python3ĭb = nnect("localhost","testuser","test123","TESTDB" ) sudo pip install mysql-python which would install 'MySQLdb' module without having to change the SQLAlchemy URI. However, if you are using Python 2, you should. if pip is not available), a tarball can be downloaded from GitHub and installed with Setuptools as follows − $ # X.X is the desired pymysql version (e.g. If you are using Python 3, DazWorrall answer worked fine for me. Just type the following in your Python script and execute it − #!/usr/bin/python3Īlternatively (e.g.
The goal of PyMySQL is to be a drop-in replacement for MySQLdb.īefore proceeding further, you make sure you have PyMySQL installed on your machine. The final bugfix release with binary installers for 3.7. See the downloads page for currently supported versions of Python and for the most recent source-only security fix release for 3.7. It implements the Python Database API v2.0 and contains a pure-Python MySQL client library. Release Date: JNote: The release you are looking at is Python 3.7.0, the initial feature release for the legacy 3.7 series which is now in the security fix phase of its life cycle. PyMySQL is an interface for connecting to a MySQL database server from Python.