I'd propose that you don't open your SQL database for direct access from outside localhost. (For security reasons.)
Instead I'd install some PHP script on the server that accesses the database and offers some limited data exchange via http+JSON with the Godot app.
Here's one of many basic php examples of delivering JSON from a mysql query:
https://www.opentechguides.com/how-to/article/php/100/mysql-to-json.html
If you pass parameters for your query from outside then be sure to either:
- filter the parameter strings to only allow very basic characters (i.e. letters, numbers, space)
- or: use statements with bound variables
The reason here is also the risk of security issues:
https://en.wikipedia.org/wiki/SQL_injection
That said: Accessing Mysql via JSON and PHP should be fairly simple. Sure, it depends on the complexity of your project.