Access MySQL database from across the Internet? lazarus / 21-General ---------------------------------------------------------------------- Cillchaoi · 2022-06-09 14:42 I am brand new to Lazarus and will start playing around with it this weekend so as to get familiar with the environment.  However, one big question I have is whether it is possible to connect to and work with a MySQL database that is stored on my website's webhosting server.  I do not have the database here locally, of course: it is stored on one of their servers wherever the blazes it is. I realize that the answer may vary from one hosting service to another, so I am asking whether anyone has had success with doing this or if this is typically not permitted due to server security issues or whatever else. Any insight, advice, and other commentary that you all can offer will be greatly appreciated. ---------------------------------------------------------------------- MarkMLl · 2022-06-09 19:30 Quote from: Cillchaoi on June 09, 2022, 04:42:13 pmI realize that the answer may vary from one hosting service to another, so I am asking whether anyone has had success with doing this or if this is typically not permitted due to server security issues or whatever else. Any insight, advice, and other commentary that you all can offer will be greatly appreciated. Speak to your service provider. Don't even dream of doing it if the connection isn't encrypted, and even then expect problems from people probing it once they've noticed the open port. MarkMLl ---------------------------------------------------------------------- Zvoni · 2022-06-10 06:20 What Mark said. Though to the original Question: I have done something like this for testing purposes. As long as you open the/a port (it doesn't have to be the Default 3306-Port) and any traffic to this "visible" port gets relayed correctly it works without Problems. Security reasons as stated by Mark not withstanding ---------------------------------------------------------------------- dseligo · 2022-06-10 09:14 If you use shared hosting then look for 'SSH access' or something similar in hosting's Control panel. You can make SSH tunnel to your web hosting this way, I used this several times. I just tried with my website's hosting and it works. I did the following: - create SSH keys (in my cPanel: Security, SSH Access, Manage SSH Keys, Generate a New Key). Create strong password for your key. I converted key to PPK format so I can use it with Putty. Download private key. I also had option to upload my own key. - set up tunnel on your computer. I use Windows, so I created new session in Putty (https://www.putty.org/):   - in Connection/SSH/Tunnels add new forwarded port (source 3307 because I have MariaDB installed locally, destination 'localhost:3306').   - under SSH/Authentication you browse for private key you downloaded.   - in SSH check 'Enable compression' and 'Don't start a shell or command at all'.   - in Connection/Data enter your username in 'Auto-login username'   - in Session enter host name and name for your session in 'Saved sessions'   - click Save Now you can open tunnel in Putty (you need to provide password for private key). After tunnel is open, you access mySQL on your web server by connecting to local host, to port you set as 'source' in Putty, and with database name, user and password as you set in your web control panel. Of course, I think that for developing and testing, it would be easier if you install mySQL server on your computer. After you are done testing, just change connection parameters. HTH ---------------------------------------------------------------------- MarkMLl · 2022-06-10 09:50 Quote from: dseligo on June 10, 2022, 11:14:56 amIf you use shared hosting then look for 'SSH access' or something similar in hosting's Control panel. You can make SSH tunnel to your web hosting this way, I used this several times. I agree, and I was just about to expand on my original answer to that effect. However that /still/ requires that the service provider make SSH available (which he might not, if the only permitted access is via a web interface) and SSH on the standard port will attract a vast amount of probe traffic (ask me how I know). Something like SSH can, of course, be protected by "port knocking", /but/ at that point you're getting sufficiently deep into host configuration that you might find it falls foul of any other attempts to be clever: containerisation, tunelling, VLANs and so on. MarkMLl