Connecting to a database on your database server
Find out how to log in to your database
Find out how to log in to your database
Last updated 16th September 2020
You can access your database’s content via an interface. There are several ways you can connect to it.
This guide explains how to connect to your database on your database server.
Please note that there is no root access.
Generic SQL commands work normally, and software such as HeidiSQL, SQuirreL or Adminer is fully compatible.
Since MariaDB is a derivative of MySQL, the commands are exactly the same for these 2 types of databases.
Log in to your OVHcloud Control Panel and select Web Cloud
in the top navigation bar. Click Databases
in the services bar on the left-hand side, then choose the SQL instance concerned.
In the General information
tab, you will find the access link in the Database administration box, under “User interface”.
You will land on the phpMyAdmin login page.
General information
tab, in the Database administration box, under “Host name” in the SQL section.Users and rights
tab of your database server.General information
tab, in the Database administration box, under “Port” in the SQL section.
(This box appears only for Private SQL servers)If the connection succeeds, the next page of phpMyAdmin will appear.
In case of error #1045
If error #1045 occurs, it means that the identification is incorrect. You will need to check your username and/or password.
In case of error #2005
If you get error #2005, we recommend checking the server name, and whether it is working properly.
To connect to your database, please ensure that you have the following information:
General information
tab of your database server, in the Database administration box under “Host name” in the SQL section.Users and rights
tab of your database server.General information
tab of your database server, in the Database administration box, under “Port” in the SQL section.Databases
tab of your database server.For a Private SQL server, this action is only possible via SSH from an OVHcloud Web Hosting plan.
mysql --host=server --user=username --port=port --password=password database_name
For a Private SQL server, you can only run this script from an OVHcloud Web Hosting plan.
1. <?php
2. $db = new PDO('mysql:host=host;port=port;dbname=dbname', 'username', 'password');
3. ?>
In our example we use the open source software SQquirreL, but other interfaces like HeidiSQL or Adminer are fully compatible.
Aliases
, then +
OK
:Connect
button.You are now connected to your database.
You can use your own phpMyAdmin interface to access the contents of your database. To do this, install phpMyAdmin on your own server or Web Hosting plan. During this installation, make sure that the information for your database server and database is correctly configured so that phpMyAdmin can connect to it.
To connect to your database, please ensure that you have the following information:
General information
tab of your database server, in the Database administration box under “Host name” in the SQL section.Users and rights
tab of your database server.General information
tab of your database server, in the Database administration box, under “Port” in the SQL section.Databases
tab of your database server.For a Private SQL server, this action is only possible via SSH from an OVHcloud Web Hosting plan.
psql --host=server --port=port --user=username --password=password database_name
For a Private SQL server, you can only run this script from an OVHcloud Web Hosting plan.
1. <?php
2. $myPDO = new PDO('pgsql:host=host;port=port;dbname=dbname', 'username', 'password');
3. ?>
In our example we use the open-source software SQuirreL, but other interfaces like HeidiSQL or Adminer are fully compatible.
Aliases
, then +
OK
:Connect
button.You are now connected to your database.
Join our community of users on https://community.ovh.com.
Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.
Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.
Discuss with the OVHcloud community