Here are some further findings:
I can connect easily to the database server using the Zeos library. In the TZConnection object I just specify the usual parameters, choose MariaDB-10 as the protocol and point the connection to the client library dll. Using libmariadb.dll I have no trouble connecting to the database. It doesn't matter whether I change the compile options by checking or unchecking "Win 32 gui application".
My conclusion is that there is no problem with the client library, but with the TMySQL57Connection object. I gather that others use it with success (mainly on Linux?), but I have not been able to use it successfully, even with a MySQL database server.
I was reluctant to use Zeos because its development seems to have stalled; the latest stable release (7.2.14) is from July 2021, nearly three years ago. But if that's all that works, it seems there is no choice.
I'd be grateful for perspectives on this point from seasoned users of Lazarus and MySQL/MariaDB.