Has nothing to do with SharePoint.
If you configure the server your MYSQL database runs on to accept Cross Origin requests you can access it from any environment.
A https connection is preferred, but not required when you manually instruct your browser to allow mixed content.
A REST middle-tier like ArrestDB in your stack simplifies access.
You are communicating from the trusted Inside (SharePoint) to the Outside; you can do anything you want. (I use this a lot to keep SharePoint Lists in sync with a public MySQL database which serve public websites)
From the cruel Outside world into SharePoint is a whole different ballgame which requires ADAL
From the outside PHP world into Office365/SharePoint world there now is: