Learn how to configure your MySQL instance to accept incoming connections.
Managed Databases (also called Cloud Databases) allow you to focus on building and deploying cloud applications while OVHcloud takes care of the database infrastructure and maintenance in operational conditions.
Requirements
- a Public Cloud project in your OVHcloud account
- access to the OVHcloud Control Panel
- a MySQL database running on your OVHcloud Cloud Databases (this guide can help you to meet this requirement)
Instructions
Configure your MySQL instance to accept incoming connections
Before making a connection, we need to verify that our MySQL instance is correctly configured.
Log in to your OVHcloud Control Panel and open your Public Cloud
project. Click on Databases
in the left-hand navigation bar under Databases & Analytics and select your MySQL instance.
Step 1: Verify your user roles and password
Select the Users
tab. Verify that you have a user and a configured password. If you don't remember the user's password, you can either create a new user or regenerate the password of an existing user.
This first user avnadmin is pre-configured during the service installation and comes with the following grants:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO "avnadmin"@"%" WITH GRANT OPTION GRANT REPLICATION_APPLIER,ROLE_ADMIN ON *.* TO "avnadmin"@"%" WITH GRANT OPTION
You can add more users by clicking on the button + Add user
.
Enter a username then click Create User →
.
...
button in the Users & Roles
table.
Step 2: Authorize incoming connections from the MySQL client
In this step, select the Authorised IPs
tab. IP addresses must be authorized here before they can connect to your database.
Clicking on + Add an IP address or IP block (CIDR)
opens a new window in which you can add single IP addresses or blocks to allow access to the database.
You can edit and retract database access via the ...
button in the IP table.
Collect required information
Select the General Information
tab to find the required login credentials in the Login Information section.
Select the Databases
tab to get the database name.
Select the Users
tab to get the username.
You can delete a user or regenerate a password via the more options ...
button in the Users & Roles table.
Go further
Visit the GitHub examples repository to find out how to connect to your database with several languages.
For more information and tutorials, please see our other Cloud Databases support guides or explore the guides for other OVHcloud products and services.