For a Debian-based system, unixodbc-dev is required, but it might not be required for Red Hat flavors (such as CentOS. Run on Windows machine, DNS-less code works fine. To set up and configure Moab to connect to a PostgreSQL database using the ODBC driver, do the following: This solution has been tested and works with these file versions: odbc-postgresql - 1:-1.2. How to fix the DSN-less connection on Linux? I tried "Servername" and "Hostname" instead of "Server" in connection string, but it did not help. However, I haven't managed to set up an ODBC DSN to connect to the remote database. The tunnel works fine when I use pgAdmin to connect to the remote database. The error message looks strange, because I'm trying to connect a remote server, not a local one. 1 I'm using SSH tunneling to connect from a Windows 7 machine to a remote Postgres database. Is the server running locally and accepting connections on that socket? Run on Linux machine, this code gives me an error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Select the User DSN tab to set up a data source that only you can access. I changed my C++ code this way: SQLCHAR* cs = "DRIVER=PostgreSQL Unicode Server=192.168.11.1 Port=5432 Database=Mydb UID=postgres PWD=****" I'm trying to connect PostgreSQL from Linux by the following C++ code: SQLDriverConnectA(., "Mydb", SQL_NTS, "postgres", SQL_NTS, "****", SQL_NTS) īut I need a solution without adding any DSN ("DSN-less"). I edited /etc/odbc.ini, added the following DSN: On Windows 圆4 editions, use the ODBC administration tool located at SystemRootSysWOW64odbcad32.exe, this will correctly locate the installed Connector/. I installed ODBC libraries and PostgreSQL ODBC driver on Linux by running the command: sudo apt-get install unixodbc unixodbc-dev odbc-postgresql You can download the official PostgreSQL ODBC driver from. Modified 5 months ago Viewed 587k times 121 I am trying to open a program for the first time on Windows XP Pro that uses PostgreSQL 9. I need to connect from Linux machine to the PostgreSQL on Windows, using C++ code by ODBC library. This document demonstrates how to connect Stata on a Windows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |