In python, is there an easy way to connect to a mysql database that does not require root access?

I am writing a script to parse some text files and paste the data that they contain into the mysql database. I do not have root access on the server this script will run on. I looked at mysql-python , but this requires a bunch of dependencies that I don't have. Is there an easier way to do this?

+4
source share
1 answer

I would recommend the MySQL Python Connector , a MySQL DB-API adapter that does not use the C client library, but rather reconfigures the MySQL protocol completely in pure Python (compatible with Python 2.5 to 2.7, as well as 3.1).

To install C-encoded extensions in Python, you usually need root access (although the server you use could change things, that not all of this is possible). But with a clean Python solution, you can simply download the modules in question (for example, those from Connector that I recommend), just like you download those you write yourself, which (if you, of course, have Valid user id and password for this MySQL database! -) can solve it for you.

+3
source

Source: https://habr.com/ru/post/1312816/


All Articles