Database

Can i connect a external mysql database?, from a server?

Welcome to the community. Yes, you can connect to an external hosted MySQL database as long as it accepts port 3306

7 Likes

A secure way to have a website is having the database externally hosted and keeping the front end of the site hosted on multiple hosting sites. The databases this way can be preserved better.

Why?

You should use the same host for database and file storage, it makes things a lot faster. I’m not sure what the evidence behind your argument for keeping them separate is.

4 Likes

Hard disagree from me there.

The most secure way to use MySQL is to not expose it to the internet. Also, by default, MySQL connections are not encrypted. So unless you make sure to setup proper TLS connections for the database, you are now also sending credentials and data unencrypted over the public internet. I hope I don’t have to explain why that’s a bad idea.

If you want your database to be preserved better, then splitting the website hosting from it won’t help you that much. Ultimately, the database is still at one provider, and if that provider decides to take down your database, then your website is down. If you care about preserving the database, then having frequent (and preferably automated) backups, with a documented and tested recovery procedure is the way to go.

And, if you don’t trust your hosting provider with your website, why are you hosting with them in the first place?

5 Likes