Remote Access To MySQL on sharing host

I am wondering if anybody knows it is possible to enable remote access to mysql on sharing host. Maybe with htaccess? Or any other way?

Thank you

The only way you can enable remote access to MySQL is through editing the MySQL server configuration (my.ini). Since shared hosts won’t let you do this for obvious reasons you’re out of luck.
Why do you want to do this? Several programs you can use on the desktop (like SQLYog or HeidiSQL) can also connect to a remote MySQL through an SSH tunnel, which is pretty easy to set up. You’d need SSH access for that of course.
Failing that, with SQLYog you can put a PHP script on the server and “connect” to that.
If all else fails there is of course PhpMyAdmin, but I would use that as a last resort only.

The reason for that is because I don’t have any database account in this hosting package. It is very cheap, and that is why it doesn’t offer that. But I have another hosting provider where I have some databases left, but not any extra domains. I will later buy higher package and move everything to one provider, but not before I make some tests.

So you want the host to connect to a MySQL database on your own PC or something?

No, to another website. I have two websites, each one on different host. One host has no databases and nother has many databases, but not any domain left.

Have you tried connecting to the MySQL on the remote host? If that didn’t work I’m afraid you’re out of luck. You could try to write an API and use that instead of connecting to MySQL directly, but does seems a bit overkill to me.
Have you contacted the host where you do have MySQL and ask if you could get an extra domain? They’d probably be willing to help you out.

Its an option in the my.cnf / my.ini as has already been said - to either enable networking, or to bind to a certain IP address on the host. Most shared hosting providers SHOULD have this locked down (not internet accessible) so I’d guess you are probably out of luck there. Best solution is to upgrade your package so you can do what you need to without faffing. MySQL over the internet isn’t the best for performance, especially if the servers are in different areas of the world (trust me… I’ve tried it, transatlantic, while migrating a website)

As an alternative, you might be able to use SimpleSQL on the the cheap server?

I am wondering if anybody knows it is possible to enable remote access to mysql on sharing host.

This should be possible via your hosting control panel (some hosts will not offer it though). Other than that, your best bet is to contact your host and ask for assistance… or plea for a bit of understanding. :slight_smile:

MySQL over the internet isn’t the best for performance

Quite true. Given that Google now takes website load speed into account, it may be yet another reason to consider getting proper hosting for the site, if getting traffic to it is important.