Connecting to a MySQL database on Loopia hosting from an external location, such as your home computer or a local development tool, requires a change to the database user’s host configuration. By default, database users on Loopia are restricted to connections from our web servers. This article explains how to allow external connections from the Loopia Customer Zone.
Why external MySQL connections fail by default
A change in the configuration of the database user is required if you want to connect to a MySQL database from an external location, for example from home using a local website, system or tool.
Adjusting the database user’s host
Log in to the Loopia Customer Zone and select the database under “Databases”. Choose “Database Users” and then the user you connect with.
In the Host field, you enter the IP address that should be allowed to connect to the database. By default, the web server’s IP address is specified as the host. This allows only the web server for the site to connect to the database, which is the safer option if you do not want external or non-privileged users to be able to connect.
If you enter % as the Host, anyone will be able to connect to the database provided they have the correct username and password.
Recommended approach
Our recommendation is to create a new user for the database via Add user, which is completely free of charge. Then set the Host for the new user to % or to the IP address of your server. This keeps the original, restricted user in place for use by your hosted website and gives you a separate user for external access.