setting up a dsn to a pervasive DB on Debian through pyodbc - python

I am trying to use python to pull data from a pervasive database, and put it in to a postgresql databse.
The postgresql connection is local and I can make that connection just fine.
However, the pervasive connection requires a dsn but I can not find the correct driver to use.
Can anybody shed some light on this problem that has been a huge problem for me these last few days?

You'll need to install the Pervasive Linux client for the version of Pervasive you are using. For example, if your Pervasive server is v11, you'd need the v11 client. If you've got v10, you need the v10 client. The v11 client s available at http://www.pervasive.com/database/Home/Products/PSQLv11.aspx and is available on Linux as an RPM or TAR.
Once you've installed the client, you'll need to use the dsnadd command to add the Client DSN as documented.

Related

is pytds the only way to connect with TLS to Microsoft SQL Server using python?

according to pytds connect documentation we have a way to provide here path to cafile to enable TLS when connecting to Microsoft SQL server. good.
I am not python specialist, what are the other ways to enable TLS using other python database drivers ?
pyodbc, (would it be located on the odbc driver config level) ?
adodbapi...
on windows the certificates are automatically found in repository, it's not the case on unix
the answers provided here are not complete enough concerning TLS in the connection string
(the finality is to use Robotframework-Database-Library to connect to MSSQL enabling only TLS v1.2 connection)
thanks

Encrypted database connection from SQLAlchemy

What are the steps required to configure SQLAlchemy with SSL support on RedHat Linux so I can connect to a MS SQL Server instance that requires an encrypted connection?
If you really want to use pymssql (as suggested by the tag on your question) then you'll need to build it from source in order for it to support SSL connections. The process will be similar to the one described in the answers to this question.
Alternatively, you may find it easier to use pyodbc along with Microsoft's SQL Server ODBC Driver for Linux.

pyodbc error: Data source name not found (Win8)

I am trying to connect using the pyodbc capability with the following connection string:
DRIVER={SQL Native Client}.
Getting the following error:
Error connecting to database: [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)
Main issue is that on my machine everything works like a charm, while execution on other machines return the error above.
Many thanks!
That is presumably because your connection string specifies some Windows datasource (a datasource is effectively an os-level alias) which exists on your machine, but does not exist on the other machines. You probably need to define the datasource on the other machines.
As Flipper suggests, first check out your connection string to determine what the name of the datasource is. Then check on your machine how that datasource is configured, then create and configure similar datasources on the other machines.
maybe check out the info and links on this ms dev-net page on datasources:
ODBC Data Source Administrator
All Windows installs include a copy of the older "SQL Server" ODBC driver
Driver={SQL Server}
so that should be available on any Windows machine for both 32-bit and 64-bit applications.
More recent versions of SQL Server have introduced their own client software to support their latest features. Drivers like
Driver={SQL Native Client} (9.0, for SQL Server 2005)
Driver={SQL Server Native Client 10.0} (for SQL Server 2008)
Driver={SQL Server Native Client 11.0} (for SQL Server 2012/2014)
will only work if the machine has the required SQL Server client software installed. (It can be downloaded and installed separately for machines that don't run SQL Server itself, usually as part of a "SQL Server Feature Pack".)
So, if you really need the more advanced features of the later "Native Client" ODBC driver then you will have to ensure that it gets installed on the other machines. Otherwise, just stick with the older "SQL Server" driver.

pymssql: How to use windows authentication when running on a non-windows box

Is there a way for python to connect to MS SQL Server using Windows Authentication, even when not running the python app on a windows box?
I'm trying to do this with pymssql, but the examples mostly seem to assume that you're running on windows.
If there is a way to make this connection using some other library, please feel free to suggest, but I do like how pymssql is simple to install and deploy via pip.
I want to connect to 2005/2008 databases, and I'm running Ubuntu 13.04 (but I can upgrade to a later Ubuntu if it makes a difference)
SOLUTION:
It turns out that pymssql can connect to my database via my windows username and password. But to do so, I need to pass the actual username/password like this:
pymssql.connect(host, 'THEDOMAIN\\theusername', 'thepassword', db)
The solution EkoostikMartin provided is still good though (if you do not want to store a password somewhere, which is probably the point to windows auth anyway)
You can use the SQL Server ODBC driver for linux, and set up Kerberos.
See this article - http://technet.microsoft.com/en-us/library/hh568450.aspx

Install MYSQLdb python module without MYSQL local install

I'm trying to install MYSQLdb on a windows client. The goal is, from the Windows client, run a python script that connects to a MySQL server on a LINUX client. Looking at the setup code (and based on the errors I am getting when I try to run setup.py for mysqldb, it appears that I have to have my own version of MySQL on the windows box. Is there a way (perhaps another module) that will let me accomplish this? I need to have people on multiple boxes run a script that will interact with a MySQL database on a central server.
you could use a pure python implementation of the mysql client like
pymysql
(can be used as a dropin-replacement for MySQLdb by calling pymysql.install_as_MySQLdb())
MySql-Connector
You don't need the entire MySQL database server, only the MySQL client libraries.
It's been a long time since I wrote python db code for windows...but I think something like this should still work.
If you're running the client only on windows machines, install the pywin32 package. This should have an odbc module in it.
Using the windows control / management tools, create an odbc entry for either the user or the system. In that entry, you'll give the connection parameter set a unique name, then select the driver (in this case MySQL), and populate the connection parameters (e.g. host name, etc.) See PyWin32 Documentation for some notes on the odbc module in pywin32.
Also, see this post: Common ways to connect to odbc from python on windows.

Categories

Resources