I’am trying to connect to a MySQL database using the MySqlCommunityServer etc, etc.
When I build the program and then Run it it works fine.
However when I try to run and debug it, then the connection fales.
On Sonoma both ways work fine.
This is the third time I switched to Sequoia and thougt the problem must be solved by now.
Who has a solution for this problem or perhaps a workaround or do I have to stick with Sonoma?
Any error messages you see?
It this a MySQLServer in the local network or a server in the internet?
If local you may miss a new entitlement to access local network…
Error Message 65 (can’t connect to MySQL Server on "192…
On the local network and it always worked until the update to Sequoia..
Its a new security feature in Sequoia:
I tried to read this, but this is beyond my knowledge.
Perhaps I will install a testing DataBase on my coding computer.
Than I have access to this testing DataBase when debugging without any problem.
In case of Building the program, I will connect to the local server.
e.g.
If DebugBuild Then
mDB.Host = “127…”
mDB.DatabaseName = “Xojo”
Else
mDB.Host = “192…”
mDB.DatabaseName = “Any”
End If
But will this be future-proof???
You need to add an entitlement to the info.plist file of your app. Something like this:
<key>NSLocalNetworkUsageDescription</key>
<string>Verbindung mit einem (lokalen) Datenbankserver aufnehmen. Connect to a (local) database server.</string>
And it would be a good idea to keep in mind that your first connection attempt may be blocked by macOS, asking the user to confirm local network access…
2 Likes
I tried to insert that in the property list of the program, but it did not work.
The question box asked to trust the connection, but after that the database was not connected
even after 10 trials.
Does your program try to establish the connection every time it starts (in an opening event)? If so, try to establish the connection manually. E.g. with a button - after the program is already running in debug mode.
Yes, the connection starts in the opening event of the App.
I tried it in the pressed event of a Button, but no connection.
Do you have any build scripts that are set to run on release but not debug builds that might be changing things?
No, just a strait testing program.
I think that the Xojo people should look at it, because it only occurs with Run (and Debug).
The only working solution for now is to install a DataBase on the coding computer for testing.
Thanks anyhow for helping.