odbc

Connect to remote MySQL db from docker container

不羁岁月 提交于 2019-11-30 08:31:20
I'm working to containerize a Django 1.5.x application that connects to a MySQL DB on a separate server via ODBC: [mysql_default] database = DB_NAME driver = /usr/lib64/libmyodbc5.so server = REMOTE_DB_SERVER user = DB_USER password = DB_USER_PWD port = 3306 I'm able to run the Django app on my local machine (outside docker) with a connection to the remote DB via port forwarding & SSH: ssh -L 3307:127.0.0.1:3306 MYID@REMOTE_DB_SERVER I've set up a Docker container for the app using Centos 6.x, but can't get the MySQL connection working. The container has MySQL installed and the mysqld running.

Linked SQL Server database giving “inconsistent metadata” error

a 夏天 提交于 2019-11-30 08:29:13
I am currently running a third-party software suite, which uses SQL Server as its database. I have a second instance of SQL Server running in a different location, and some apps that I am building in that instance SQL Server needs to access some data in the third-party software. So, I created an ODBC connection between the boxes, and set up the third-party SQL server as a linked server on my version of SQL Server. As a test, I ran something like the following statement from my SQL server, accessing one of the third-party's tables: SELECT * FROM LinkedServerName.SchemaName.dbo.TableName To

64 bit ODBC Exception

旧街凉风 提交于 2019-11-30 08:28:05
I am getting the following ODBC exception when I moved my development platform from Windows XP X86 to Windows 7 X64: ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application What I'm sure it means is that the server it is connecting to is 32 bit, and the computer I'm running on is 64 bit and the ODBC driver in use is 64 bit. The application I am writing is set to run in 32 bit mode because some of the third-party software that we employ is not 64 bit compatible. I tried downloading a 32 bit driver and changing the DSN

Character encoding issue with PDO_ODBC

南楼画角 提交于 2019-11-30 07:34:16
When accessing a Microsoft SQL Database from PHP using PDO_ODBC with the following code, I have an encoding issue. When outputed the text from the DB is garbled. $dsn = "odbc:DRIVER={SQL Server};SERVER=$hostname;DATABASE=$database;charset=UTF-8"; $pdo = new PDO($dsn,$username,$password); $sql = "SELECT text FROM atable"; $result = $PDO->query($sql); while($data = $result->fetchObject()){ $values[] = $data->text; } dpm($values); (source: bayimg.com ) This is done from a Drupal module. Everything in Drupal is made to work with UTF-8. The cleanest solution would be to able to retrieve the data

How to search for rows containing a substring?

纵饮孤独 提交于 2019-11-30 06:50:51
问题 If I store an HTML TEXTAREA in my ODBC database each time the user submits a form, what's the SELECT statement to retrieve 1) all rows which contain a given sub-string 2) all rows which don't (and is the search case sensitive?) Edit: if LIKE "%SUBSTRING%" is going to be slow, would it be better to get everything & sort it out in PHP? 回答1: Well, you can always try WHERE textcolumn LIKE "%SUBSTRING%" - but this is guaranteed to be pretty slow, as your query can't do an index match because you

How to check if a table exists in Hive?

人盡茶涼 提交于 2019-11-30 06:44:12
I am connecting to Hive via an ODBC driver from a .NET application. Is there a query to determine if a table already exists? For example, in MSSQL you can query the INFORMATION_SCHEMA table and in Netezza you can query the _v_table table. Any assistance would be appreciated. There are two approaches by which you can check that: 1.) As @dimamah suggested, just to add one point here, for this approach you need to 1.1) start the **hiveserver** before running the query 1.2) you have to run two queries 1.2.1) USE <database_name> 1.2.2) SHOW TABLES LIKE 'table_name' 1.2.3) Then you check your result

Simplest Way to Test ODBC on WIndows

给你一囗甜甜゛ 提交于 2019-11-30 06:43:06
问题 With unixODBC you can use a simple command line utility called "isql" to test your connection and permissions of some queries. Without having to write extra code or install libs or bloated programs, is there a simple way to open up X data source send some sql commands and be done with it? Doing this on the command line would be preferable. 回答1: One way to create a quick test query in Windows via an ODBC connection is using the DQY format. To achieve this, create a DQY file (e.g. test.dqy )

Missing libtdsodbc.so in freetds-dev - MSSQL on Ubuntu

℡╲_俬逩灬. 提交于 2019-11-30 03:48:49
I'm trying to get MSSQL working on Ubuntu 12.04 via ODBC, and I've followed these steps to the letter: http://jamesrossiter.wordpress.com/2011/03/08/connecting-to-microsoft-sql-server-using-odbc-from-ubuntu-server/ However, this omits both of these files that are pointed at in odbcinst.ini: Driver = /usr/lib/odbc/libtdsodbc.so Setup = /usr/lib/odbc/libtdsS.so So, I googled a bit and found this: http://ubuntuforums.org/showthread.php?t=433435&page=2 So I followed those instructions and put libtdsodbc.so in /usr/lib/odbc/, but I still get this error: Can't open lib '/usr/lib/odbc/libtdsodbc.so'

DSN-less connection with PHP ODBC using MDBTools Driver

别来无恙 提交于 2019-11-30 03:40:55
问题 I'm attempting to read from an Access database using MDBTools drivers to execute an odbc_connect on Ubuntu 11.10. It's working fine when using the DSN setup in /etc/odbc.ini . Below are the contents of /etc/odbc.ini : [logindb] Description = Microsoft Access Try DB Driver = MDBToolsODBC Database = /home/folder1/TestDb.mdb Servername = localhost The Driver attribute in odbc.ini references MDBToolsODBC , so, here is my odbc setup in /etc/odbcinst.ini : [MDBToolsODBC] Description = MDB Tools

Common ways to connect to odbc from python on windows? [closed]

牧云@^-^@ 提交于 2019-11-30 01:40:47
What library should I use to connect to odbc from python on windows? Is there a good alternative for pywin32 when it comes to odbc? I'm looking for something well-documented, robust, actively maintained, etc. pyodbc looks good -- are there any others? You already suggested pyodbc , and I am going to agree with you. It has given me the least amount of issues in my experience; I've used pymssql and adodbapi , and when those threw exceptions/created issues, I swapped out the code and replaced it with pyodbc and it either fixed the problem, or gave better error messages so I could debug faster. It