Is there a way to query a netezza database without explicitly installing its driver? I am using ubuntu 64 bit OS, our IT support says the driver they have only works on red hat systems.
If you can get your hands on the JDBC driver, you could use the Python, jaydebeapi module, with the driver to connect to the server. Note that there are a couple quirks involved. Namely things like boolean datatypes.
You can use pyodbc.
pyodbc is an open source Python module that makes accessing ODBC
databases simple. It implements the DB API 2.0 specification but is
packed with even more Pythonic convenience.
On Ubuntu systems, all you need to do is run
sudo apt install unixodbc-dev
before attempting
pip install pyodbc
See more details from Installing pyodbc.
Related
I'm working to an apllication that uses selenium for scraping a webpage and stores the data in a mysql database. I'm using mysql server 8.0 and i want to be able to use this application in a mac computer.
Is there a way to do that? If yes how?
You can install Python and MySQL server on your Mac using Homebrew. From here you can install your necessary Python dependencies via pip and run your application.
Alternatively, you could setup the application as a Docker service with containers for each component. This is probably the easiest way, though you'll need to navigate the docker learning curve.
I'm trying to read large amounts of data from Postgres on Linux via Python. SQL Alchemy is unacceptably slow. turbodbc https://github.com/blue-yonder/turbodbc bills itself as being fast, but seems to require an ODBC source, which is Windows, not Linux, AFAIK. (The Postgres FTP site has only .dlls for ODBC.) Yet, it claims Linux / Postgres compatibility.
How do I access Postgres on Linux via turbodbc or any other ODBC?
turbodbc works with PostgreSQL and Linux. This requires the packages unixodbc and odbc-postgresql to be installed. Then you need to set up a data source according to PostgreSQL's specifications.
The one issue here is that it won't be blazingly fast. Turbodbc is just an efficient way to communicate with the ODBC driver, basically exploiting bulk operations. However, the ODBC driver freely available for PostgreSQL itself is pretty slow. There is not much turbodbc can do about this.
I'd recommend psycopg2 or asyncpg (the latter requires Python 3.5, but is indeed very fast).
My pyramid application connect to MS SQL server using pyodbc driver. For connecting to DB, it uses Microsoft ODBC driver for Linux (http://www.microsoft.com/en-us/download/details.aspx?id=36437). Now how can I install those drivers on openshift
Thanks
Aniruddha
Someone may be able to provide a more thorough answer, but I thought this might help get you started:
While I've never installed it myself... you should be able to download the zip/tar file in your ~/app-root/data/ on your gear and then be able to extract it. Depending on how/where it installs you might be able to successfully get it implemented.
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.
I'm trying to use sqlalchemy on Cygwin with a MSSQL backend but I cannot seem to get any of the MSSQL Python DB APIs installed on Cygwin. Is there one that is known to work?
FreeTDS + unixodbc + pyodbc stack will work on Unix-like systems and should therefore work just as well in Cygwin. You should use version 8.0 of TDS protocol. This can be configured in connection string.