I have recently been trying to resolve a problem connecting remotely to a database server (Firebird, MySQL, PostgreSQL, MariaDB). I am on a Mac running Sequoia. After many iterations (see thread "PostgreSQL 'No route to host'" for details) of troubleshooting involving multiple database platforms, builds of Lazarus, builds of FPC, and component sets, I have come to believe that the problem is a new security mechanism in MacOS Sequoia and later that governs access to local networks. My initial development was using a local SQLite3 database. The issues entered when I wanted to promote the solution to a server based database.
I am out of my depth on this topic so forgive me if my details are incomplete or possibly incorrect. My understanding is that in Sequoia and later, Apple requires applications using UDP multicast functionality to include a multicast entitlement. This triggers a registration of the application and a prompting of the user for permission to allow. It appears that database access for remote databases using Lazarus components is falling into this category. Lazarus applications don't have this entitlement set The net effect is that remote database access using Laz on a Mac is effectively disabled. From first glance, it appears that the process to include this entitlement into your codebase is pretty extensive.
From what I have read, this impacts multicast and not unicast and only on resources on your local network (databases on localhost are not a problem). I don't know if multicast is required for database access as-is within Laz/FPC or if unicode could suffice. That is way beyond my capabilities. It is interesting to me that other applications that I use for database access don't have this issue. For example, I use DBeaver to manage databases. It uses JDBC and has no problem connecting and it has not registered and requested permission (Mac users can look at System Settings / Privacy & Security / Local Network to see the applications that have registered and their permission setting). That seems to me to indicate that database servers can be accessed in a way that doesn't require the multicast entitlement.
My scenario can be easily replicated. It requires starting Lazarus once as an application and once from the command line. Luckily FPCUpDeluxe sets this up when that tool is used to build environments. If you run Laz from the generated script via your terminal and create a simple form with a TSQLConnector, a TSQLTransaction, a TSQLQuery, and, if you want, a TDatasource and a data aware control. Configure the components appropriately to access a remote database of your choosing. When the components are set to Connected/Active everything works correctly. If you have never been prompted for local network access for your terminal, that will pop up when you first connect. If you compile the program, and run it, you will get the 'no route to the host' (or similar) error. If you shutdown Lazarus and restart using the application icon the 'no route to the host' error will occur when you try to connect in design. Again, this is because the terminal program has gained permissions but Lazarus has not. I don't know, but I suspect that all newly created applications will need to incorporate this "multicast entitlement" or there will need to be way to connect without using UDP multicast. I have run into this problem with remote database connectivity, but I imagine there are other possible areas where this new setting could impact solutions coded in Laz/FPC.
I am hopeful that people with far greater knowledge of this topic can weigh in.
From online discussions regarding this issue for MacOS developers...
What operations require the multicast entitlement?
The general rule is that sending or receiving multicast or broadcast traffic requires the multicast entitlement (com.apple.developer.networking.multicast). Common scenarios include:
Sending a UDP unicast — no
Sending a UDP multicast — yes
Sending a UDP broadcast — yes
Receiving an incoming UDP unicast — no
Receiving an incoming UDP multicast — yes
Receiving an incoming UDP broadcast — yes