0

I need a DSN to connect to a MariaDB (Ubuntu's replacement for MySQL) database and seem to have run into some confusion about ODBC drivers on Ubuntu (and Linux in general).

Specifically, Flora-2 requires a DSN to connect to enable persistence:

    ?- ?Module[attach(?DSN,?DB,?User,?Password)]@pm.

This action associates the data source described by an ODBC DSN with the module. If ?DB is a variable then the database is taken from the DSN. If ?DB is bound to an atomic string, then that particular database is used. Not all DBMSs support the operation of replacing the DSN’s database at run time. For instance, MS Access or PostgresSQL do not. In this case, ?DB must stay unbound or else an error will be issued. For other DBMS, such as MySQL, SQL Server, and Oracle, ?DB can be bound.

Bringing up ODBCCreateDataSourceQ4 to create the DSN, the Driver window shows no drivers. The Help states "ODBC Drivers must be registered when/after they are installed on your system." This sent me down a rabbit hole where I found myself confronting a number of questions:

  1. Trying find out what it means to "register" an ODBC driver takes one down a long list of Windows-related topics -- all of which are of no use to getting an Ubuntu ODBC driver "registered". The word "register" seems to derive from the "Windows Registry". What is the Linux counterpart to the Windows "Registry"?
  2. Why wouldn't the package manager automatically "register" the ODBC driver when it is installed?
  3. There are a number of ODBC "drivers" that seem to be application-specific (LibreOffice, Erlang, etc.) which seems to contradict the very meaning of "driver". Why would a "driver" be application-specific?
  4. The closest thing I could find to an application-independent ODBC driver that ODBCCreateDataSourceQ4 might recognize is myodbc, but the myodbc package has been removed from Ubuntu! Isn't there something that is supported by the standard Ubuntu repositories for this?
  5. I'm aware that I can get source code, compile and install a replacement at the MariaDB Foundation website but:
    1. This seems a bizarre adaptation for something that seems so-essentially part of such a widely-used package's function. The open source model for Ubuntu seems to have failed here. What's going on?
    2. One must provide user registration details like the kind of business one is involved with to download this source code. Again, this seems very strange in an open source environment given the essential nature of database connectivity and ODBC's prominent place in that connectivity. What's going on?
James Bowery
  • 573
  • 1
  • 4
  • 17
  • Please describe (edit your question) how you are trying to connect? Is MySQL on Ubuntu and you are trying to connect to MySQL from another Ubuntu computer using `Base` ? Trying to connect to MySQL fom an MS Windows computer using `MS Access`? For the time being see this post: "Connect MySQL and Base". https://wiki.openoffice.org/wiki/Connect_MySQLandBase#Using_JDBC_on_Linux – Steve R. Jun 22 '17 at 20:23
  • I provided the context necessary to satisfy your request. As I am not concerned with whether the database is on Ubuntu or not, I'm happy to be constrained to a database server that is running on the same Ubuntu system as the client. Moreover, the so-called "MySQL" is, in fact, MariaDB -- but the nomenclature is now in a confused state due to Ubuntu shifting to MariaDB as a replacement for MySQL. It is for this reason that the link you provided does not seem to be much help. – James Bowery Jun 24 '17 at 16:24
  • Thank-you for modifying your post. My experience with an `ODBC` connection to MySQL/MariaDB is limited to `MS Access` and `Base`. Sorry that link didn't help, but it did contain the word `register` and described the process. Unfortunately, it appears that your revised question adds context that goes beyond what I am familiar with. – Steve R. Jun 24 '17 at 22:33
  • After a few days of googling and trying to piece together the "installation instructions" for MariaDB odbc configuration, I did manage to locate a combination of URLs that permitted me to, somewhat by educated trial and error, manually install a driver file and configure `/etc/odbcinst.ini` and `~/.odbc.ini`: https://askubuntu.com/a/846819/284313 and https://mariadb.com/kb/en/mariadb/how-do-i-install-the-odbc-connectordriver-on-linux-mint-173/ with driver from https://downloads.mariadb.com/Connectors/odbc/connector-odbc-2.0.15/mariadb-connector-odbc-2.0.15-ga-debian-x86_64.tar.gz – James Bowery Jun 24 '17 at 23:49
  • By the way, I'm not sure those URLs are all that is needed. I also installed some packages `unixodbc-bin libmariadb2 mariadb-plugin-connect tdsodbc`. I'm not sure if any of those are necessary nor am I sure whether installing any of them might be inadvisable given the transition to MariaDB under Debian 9. – James Bowery Jun 24 '17 at 23:51

0 Answers0