此内容没有您所选择的语言版本。
8.9. Configure ODBC Options on Red Hat Enterprise Linux
Procedure 8.3. Configure ODBC Options on Red Hat Enterprise Linux
- Install the driver manager:
yum install unixODBC
yum install unixODBC
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify that your PostGreSQLdriver has installed correctly:
odbcinst -q -d
odbcinst -q -d
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To create the DSN, open the configuration file in a text editor:
sudo vi /opt/redhat/odbc.ini
sudo vi /opt/redhat/odbc.ini
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
You must either use sudo or be logged in as root to open this file. - Add the following configuration settings to the file:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file and exit the text editor.
- Run this command to test the DSN:
isql <DSN-name> [<user-name> <password>] < commands.sql
isql <DSN-name> [<user-name> <password>] < commands.sql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To connect without DSN, use this DSN-less connection string:ODBC;DRIVER={PostgreSQL};DATABASE=<vdb-name>;SERVER=<host-name>;PORT=<port>;Uid=<username>;Pwd=<password>
ODBC;DRIVER={PostgreSQL};DATABASE=<vdb-name>;SERVER=<host-name>;PORT=<port>;Uid=<username>;Pwd=<password>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you run isql but you encounter an error whereby you see this message: "Can't open lib '/opt/redhat/jboss-dv/v6/psqlodbc/lib64/psqlodbc.so' : file not found" it means that some of the postgres libraries are missing.To fix this issue, run this command as root:yum install postgres
To verify that the packages are now installed, run this command:rpm -qa|grep post
You should see the postgresql and postgresql-jdbc packages listed.