Interact with SQL database using only Python 2.4 - python

I have a website on an Australian webhost. I have designed my website to allow people to login & their login details are stored in an SQLite3 database. I interact with the SQLite3 database using pythons SQLite3 module(found only in python2.5 & up)
My Problem: the webhost runs Python 2.4 so I cannot communicate with(query or modify) my SQLite3 database. The webhost will not allow me to install my own version of python or upload modules unless I upgrade to VPS.
What do you think are my options to still be able to work/interface with my SQL database? Do you know of way to interact with a SQL database using python modules from Python 2.4 or earlier?
Do you know of a python 2.4 module that will let me interact with an SQL database(can be MySQL, SQLite, etc.)?

There is a Python MySQL Module, called MySQLDB, which supports Python 2.3-2.7: http://sourceforge.net/projects/mysql-python/
The User Guide can be found here: http://mysql-python.sourceforge.net/MySQLdb.html

Check out pysqlite. It is the same module as in the newer python versions and I have used it no prob in 2.4 before.

Related

How to connect to SQLite3 database in python remotely

I use SQLite3 in python because my school computers don't allow us to install anything to python so I used the pre installed SQLite3 module.
I'm working on a program whose back end relies on an SQLite3 database, however the databases are created and stored on their computer.
Is it possible for me to "Host" an SQLite3 database on let's say a server and allow my script to access them remotely (my script could edit the database from my school computer)?
By the way, I'm using python 3.X
EDIT
i made a database api that runs in python 3, its called TaliffDb
to install type pip3 install TaliffDB in your terminal. im working on a documentation, but please do comment if you have any questions
Write an API on the remote server, yes. This could be hosted by a web framework of your choice.
You won't get a direct network connection to a file

Connecting SQL Server with Python 2.7

I am trying to connect Python 2.7 to SQL Server to access all the tables it is currently hosting.
I am using for my official purposes so want only legal solutions to my problem.
Tried using a few of the solutions suggested her but none of them worked and most of them were not at all descriptive as I am new to Python.
Also is it possible to import a large table from SQL directly as a temp table(in python) and then work on it instead of accessing the DB everytime.
Details:
OS- Windows 10
DB- SQL Server 2012 (SQL server management studio)
Python- Spyder(Anaconda) for Python 2.7
thanks in advance for your help.
regards
Hitesh

How to config Django using pymysql as driver?

I'm new to Django. It wasted me whole afternoon to config the MySQL engine. I am very confused about the database engine and the database driver. Is the engine also the driver? All the tutorial said that the ENGINE should be 'django.db.backends.mysql', but how the ENGINE decide which driver is used to connect MySQL?
Every time it says 'django.db.backends.mysql', sadly I can't install MySQLDb and mysqlclient, but PyMysql and the official mysql connector 2.1.3 has been installed. How could I set the driver to PyMysql or mysql connector?
Many thanks!
OS: OS X Al Capitan
Python: 3.5
Django: 1.9
This question is not yet solved:
Is the ENGINE also the DRIVER?
You can import pymsql so it presents as MySQLdb. You'll need to do this before any django code is run, so put this in your manage.py file
import pymysql
pymysql.install_as_MySQLdb()
The short answer is no they are not the same.
The engine, in a Django context, is in reference to RDBMS technology. The driver is the library developed to facilitate communication to that actual technology when up and running. Letting Django know what engine to use tells it how to translate the ORM functions from a backend perspective. The developer doesn't see a change in ORM code but Django will know how to convert those actions to a language the technology understands. The driver then takes those actions (e.g. selects, updates, deletes) and sends them over to a running instance to facilitate the action.

Do I need MySQL installed on my local PC to use MySQLdb for Python to connect MySQL server remotely?

I'm trying to use python for manipulating some data in MySQL DB.
DB is on a remote PC. And I will use another PC with Python to connect to the DB.
When I searched how to install MySQLdb module to Python, they all said MySQL need to be installed on the local PC.
Is it right? Or I don't need to install MySQL on the local PC?
You just need it if you want to compile the Python MySQL bindings from source. If you already have the binary version of the python library then the answer is no, you don't need it.

In python, is there a simple way to connect to a mysql database that doesn't require root access?

I'm writing a script to parse some text files, and insert the data that they contain into a mysql database. I don't have root access on the server that this script will run on. I've been looking at mysql-python, but it requires a bunch of dependencies that I don't have available. Is there a simpler way to do this?
I would recommend the MySQL Python Connector, a MySQL DB-API adapter that does not use the C client library but rather reimplements the MySQL protocol completely in pure Python (compatible with Python 2.5 to 2.7, as well a 3.1).
To install C-coded extensions to Python you generally need root access (though the server you're using might have arranged things differently, that's not all that likely). But with a pure Python solution you can simply upload the modules in question (e.g. those from the Connector I recommend) just as you're uploading those you write yourself, which (if you of course do have a valid userid and password for that MySQL database!-) might solve it for you.

Categories

Resources