I'm currently trying to get access to some MYSQL and PostgreSQL databases via an ODBC connection via an ODBC Administrator GUI as I had on Windows. After searching around, I have only found scattered and old tutorials for installing and setting up ODBC connections on Ubuntu.
Can someone help me with a more up to date instructions as I am working in a delicate production environment so the last thing I need a screwup? Thank in advance.
You should always periodically copy your production environment to a test environment for user training and a development environment for yourself. You don't want your trials and errors effecting production (the company's bottom line) or user training (they are already enough challenge day to day without messing up their world).
That said, here are some newer ODBC (Open Database Connection) tutorials for you:
This answer only explains how to install MySQL ODBC drivers. I guess for Postgres, you will have to ask the drivers from Postgres. See this page for more info on that: http://www.unixodbc.org/, under the theme 'Drivers'.
Get and install the MySQL drivers from MySQL here: https://dev.mysql.com/downloads/connector/odbc/. That will create the files
libmyodbc5X
(where the X depends on which driver has been installed) andlibodbcmy.so
in/usr/lib/x86_64-linux-gnu/odbc
. The first one is the driver, the second is the managing driver (not very useful).Create two files in
/etc
:odbcinst.ini
andodbc.ini
The first one contains the specification of the available drivers. In your case, there will be two of them, one for MySQL, the other one for Postgres. The second one is the collection of database source name. Each one specifies at least a name, between brackets [], and a driver name.For example, my
odbcinst.ini
contains:and my
odbc.ini
contains two entries, one for the production database, one for the testFrom that point on, you can connect just using the DSN name (Prod or TestDB). Of course, it might be wise to put your username/password elsewhere. The exact way to connect to DSN depends on the programming language/development tool that you use.