Sample Header Ad - 728x90

Can't use ODBC to connect to MariaDB

0 votes
0 answers
1076 views
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" LibreOffice 6.4.7.2. I want to run LibreOffice Base as the front end, using ODBC. I previously had MySQL installed in this OS and managed to get ODBC working for LibreOffice Base. Now I have removed MySQL and installed MariaDB. **Incidentally, I am now beginning to wonder whether this a LibreOffice glitch. Wouldn't be the first. Any successful experience of getting ODBC to work with MariaDB (specifically) in Linux could be helpful. Though in fact I seem possibly to have got it working in fact (see below: isql with my configured DSN works!).** 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/lib/libmaodbc.so Driver64=/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 = user_mike Password = user_mike 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"? But I *chose* the DSN. "default driver"? How might I specify that, I wonder! 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. I found this answer . This led me to check my .cnf file(s), NB under /etc/mysql... 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? So what might be the issue?
Asked by mike rodent (111 rep)
Apr 1, 2022, 12:00 PM
Last activity: Apr 4, 2022, 06:59 PM