0

Linux Mint 20 (Ubuntu 20).

MariaDB version: "mariadb Ver 15.1 Distrib 10.7.3-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2"

I want to run LibreOffice Base as the front end, using ODBC.

I have tried to follow the MariaDB instructions here.

I have put the file libmaodbc.so in /usr/lib64/. I believe this is the main connector file.

I have made a file /etc/odbcinst.ini as follows:

[MariaDB]
Description=MariaDB Connector/ODBC v.3.0
Driver=/usr/lib64/libmaodbc.so
UsageCount=1

and a file /etc/odbc.ini as follows:

[localdb]
Description           = MariaDB connection to  database
Driver                = MariaDB
Database              = localdb
Server                = localhost
User                  = root
Password              = root
Port                  = 3306
Socket                = /var/run/mysqld/mysqld.sock

When I try to connect using LO Base, this ODBC entry "localdb" is seen. But then when I test out the connection I get:

"[unixODBC][Driver Manager]Data source name not found, and no default driver specified"

"Data source name"? "default driver"?

Anyone know what I should do? My theory is that the odbc.ini file references the odbcinst.ini file, which in turn drives the libmaodbc.so file.

NB if I go as far as trying to actually make the connection, i.e. to get a list of tables in the database in LO Base, I get

"The connection to the data source "xxx"* could not be established
[ma-3.1.15]Can't connect to local server through socket '/var/run/mysqld/mysqld.sock' (13)"

* i.e. the LO Base filename minus the ".odb" extension.

And also to check my socket (with the MariaDB service running):

mike@M17A:~/MariaDB_files$ netstat -ln | grep mysql
unix  2      [ ACC ]     STREAM     LISTENING     263752   /var/run/mysqld/mysqld.sock

... interesting: seems to suggest that the socket is alive and well.

Also I can connect using isql localdb from the CLI: doesn't this suggest things are set up OK?

mike rodent
  • 1,092
  • 1
  • 11
  • 21

1 Answers1

0

The library is located in lib64, so we can guess it is a 64-bit version, but it defined as 32-bit.

Check your folder /usr/lib/ it should also have libmaodbc.so file, but it would be a 32-bit version.

Then modify the driver definition to:

[MariaDB]
Description=MariaDB Connector/ODBC v.3.0
Driver=/usr/lib/libmaodbc.so
Driver64=/usr/lib64/libmaodbc.so
UsageCount=1
White Owl
  • 4,511
  • 1
  • 4
  • 15
  • Thanks. libmaodbc.so present in both (shouldn't they have different names?). Edited. For good measure I restarted mariadb service. Tried establishing ODBC connection for LO Base. Same error. Another curiosity is that `isql localdb` works, i.e. connects. Also that the socket appears to be working OK. See update. – mike rodent Apr 01 '22 at 13:19