title | excerpt | updated |
---|---|---|
Troubleshooting common database errors |
Find out how to diagnose the most common cases of database errors |
2024-09-26 |
Your database usage may result in anomalies on your website or error messages in the OVHcloud Control Panel, as well as on the phpMyAdmin interface.
Find out how to troubleshoot database errors with OVHcloud Web Hosting plans.
Warning
OVHcloud is providing you with services for which you are responsible, with regard to their configuration and management. You are therefore responsible for ensuring they function correctly.
This guide is designed to assist you in common tasks as much as possible. Nevertheless, we recommend that you contact a specialist service provider and/or discuss the issue with our community on if you have difficulties or doubts. You can find more information in the Go further section of this guide.
- an OVHcloud Web Hosting plan
- access to the OVHcloud Control Panel
- an OVHcloud database service: Start SQL or Web Cloud Databases
First, check on https://web-cloud.status-ovhcloud.com/ whether your data centre, hosting cluster or Web Cloud Databases server is affected by an incident on the OVHcloud infrastructure.
[!primary]
You can find these details in your OVHcloud Control Panel, in the
Web Cloud
{.action} section:
- To find your Web Hosting plan's data centre and filer (file server), open
Hosting plans
{.action} and select the plan concerned. The information is available in theGeneral information
{.action} tab.- To find the cluster of servers on which your hosting is located, click on the
FTP-SSH
{.action} tab. The cluster identifier is part of the name of yourFTP server
.- To retrieve the name of your Web Cloud Databases server, click on
Web Cloud Databases
{.action} in the left-hand menu, then on the relevant service. You can find the information concerned under the headingHost name
in theSQL
part of theGeneral information
{.action} tab.
Log in to the file storage space of your Web Hosting plan by FTP and find your website’s configuration file (for example, a WordPress website will have a wp-config.php file located in the folder containing your website).
Warning
The name and content of the file relevant for database connection information depends on the CMS used for the website. This does not lie in the scope of responsibility of OVHcloud.
We recommend that you contact the publisher of the CMS concerned or a specialised service provider if necessary. We will not be able to assist you with this.
Then check the exact match between the login details for phpMyAdmin and the login details for your website’s configuration file.
If necessary, change your database password.
If your website displays an "Error establishing a database connection" message and your hosting cluster is not affected by an incident, log in to the FTP storage space of your hosting and open the directory containing your website (by default, this is the "www" folder).
If this is a WordPress site, open the file "wp-config.php".
define('DB_NAME', 'my_database');
/** MySQL database username */
define('DB_USER', 'my_user');
/** MySQL database password */
define('DB_PASSWORD', 'my_password');
/** MySQL hostname */
define('DB_HOST', 'my_server.mysql.db:port');
In your OVHcloud Control Panel, open the Hosting plans
{.action} section and click on the Databases
{.action} tab. Check the correspondence between the elements displayed and those in the file wp-config.php
:
- my_database must match what is noted as
Database name
; - my_user must match what is noted as
User name
; - my_password corresponds to your database password;
- my_server.mysql.db must match the
Server address
.
[!primary]
If you are unable to restore access to your website as a result of these changes, back up your database then restore it to an earlier date from your OVHcloud Control Panel.
Contact a specialised service provider if necessary. We will not be able to assist you with this.
You have received an email notification stating that the amount of data on your database exceeds the authorised limit. Your database has therefore been switched to read-only mode. This will prevent your website from being modified.
There are three ways you can unblock your database in this situation.
If you have a Starter or Personal Web Hosting plan, we recommend that you switch to the high-performance offer. This subscription change will increase the size of your database which will automatically reopen it. This method is the simplest and does not require any particular technical expertise.
Warning
The increase of the size of your database may be linked to a malfunction in your website's internal code.
In this case, changing your Web Hosting plan would be ineffective, as your database will continue to fill up.
If you notice a sudden increase in the size of your database, or if you have a "blog" type site that normally does not use much data, we advise you to contact a specialised service provider as soon as possible. We will not be able to provide you with support on this matter.
To upgrade your subscription, log in to your OVHcloud Control Panel and open Hosting plans
{.action} in the left-hand menu. Select the relevant service and click on the ...
{.action} button in the Solution
section of the right-hand info box, then select Upgrade
{.action}.
If you are already subscribing to a Performance offer, refer to method 2.
You can also migrate your data to a new database:
- Order a larger database service if necessary, then create the new database;
- Duplicate the content of the old database to the new database or perform an export of your data, then import your data in the new database;
- Integrate the credentials of the new database into the configuration file of your site.
[!primary]
If you have a Performance Web Hosting plan, you can also activate a free Web Cloud Databases service.
Once you have made a database backup, log in to your phpMyAdmin interface to delete any unnecessary data using the Drop, Delete and Truncate commands.
Then update the data usage from the Databases
{.action} tab of the relevant service. Click on the ...
{.action} button next to the database concerned, then select Recalculate the quota
{.action}.
Warning
This operation requires advanced technical knowledge. We recommend contacting a specialised service provider if you need to use this method. We will not be able to assist you with this.
To optimise your database, follow the instructions in our guide "Configuring your database server". Then update the data usage from the Databases
{.action} tab of the relevant service. Click on the ...
{.action} button next to the database concerned, then select Recalculate the quota
{.action}.
Warning
If the advice on how to optimise your database is not sufficient to unblock the access to your website, we recommend you to contact our community or OVHcloud partners. We will not be able to assist you in this regard.
The following message in the Web Cloud Databases
{.action} section of your OVHcloud Control Panel indicates that your Web Cloud Databases server has consumed too much resources on the OVHcloud infrastructure:
In this situation, you can increase the amount of RAM available from the Web Cloud Databases
{.action} section of your OVHcloud Control Panel. In the General information
{.action} tab, click on the ...
{.action} in the RAM
section.
Warning
To increase the amount of RAM, the database needs to be a standalone service and not one of those included with a Performance web hosting plan. If you want to increase the amount of RAM of a database included in the Performance offers{.external}, you first need to detach it.
To detach the database, log in to your OVHcloud Control Panel and select Web Cloud
{.action}. Click Hosting plans
{.action}, then choose the web hosting plan that has the database activated.
In the Configuration
box, click the ...
{.action} button to the right of Web Cloud Databases
, then click the Detach
{.action} button.
You can also optimise your database by following the instructions of our guide "Configuring your database server".
[!primary]
If you experience any difficulties in decreasing the use of resources on your database server, please contact our community of users or OVHcloud partners. We will not be able to assist you with this.
"#1044 - Access denied for user to database"
This error message means that the database you are trying to import contains elements that are not authorised on the OVHcloud shared infrastructure.
First make sure that your database is empty from the Databases
{.action} tab of the relevant service. Click on the ...
{.action} button next to the database concerned, then select Recalculate the quota
{.action}. (If you need to save the existing data first, follow the backup instructions, then delete the data and relaunch the import operation.)
You can also tick the Empty the current database
{.action} box just before launching the import:
If necessary, contact our user community or OVHcloud partners for more information. We will not be able to assist you in correcting this issue.
[!success]
You cannot have a "trigger" in your database’s import script on OVHcloud shared hosting servers. In this situation, import your database to a Web Cloud Databases server.
The following query is also not allowed:
CREATE DATABASE IF NOT EXISTS `Database-Name` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
Use this line instead:
USE `Database-Name`;
Replace Database-Name
with the name of the database as displayed in your OVHcloud Control Panel.
"404 ERROR MySQL server has gone away"
This error message appears when importing a database on a Web Cloud Databases server. I most cases, it is caused by the quantity of data to be imported being too large or by non-optimised SQL queries in the import script.
To resolve this issue, you can use the following methods:
-
Increase the amount of RAM: go to the Web Cloud Databases server concerned in the
Databases
section of your OVHcloud Control Panel. Then click on the...
{.action} button in theRAM
section and selectChange the amount of RAM
{.action}. -
Split your database in order to import it through multiple operations instead of one. (For any questions on the necessary steps, contact our community or OVHcloud partners. We will not be able to assist you with this.)
-
Optimise your database, then repeat the export/import operations.
"mysqli::real_connect(): (HY000/1045): Access denied for user"
This error message may appear when connecting to your database by phpMyAdmin. It indicates that the credentials entered are incorrect.
In this situation, check the credentials entered and change your database password if necessary.
"mysqli_real_connect(): (HY000/1040): Too many connections"
The maximum number of active connections for databases delivered with a shared hosting (Start SQL) is 30.
This number increases to 200 for the Web Cloud Databases service. (This setting can be modified in the Configuration
{.action} section of your database service.)
A "Too many connections" error when connecting to phpMyAdmin appears, if this maximum number of connections is exceeded.
In this situation, you will need to optimise your databases in order to reduce the number of active connections.
Warning
If you have any questions about the changes you need to make in order to reduce the number of active connections to your database, please contact our community or OVHcloud partners. We will not be able to assist you in this regard.
"mysqli::real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known"
This error message appears when connecting to phpMyAdmin if the server name entered is incorrect.
Check the server name for the relevant database service in your OVHcloud Control Panel.
[!success]
If the database you would like to connect to appears in the
Databases
{.action} tab of theHosting plans
{.action} section of your OVHcloud Control Panel, the name to enter is in theServer address
column.If you want to connect to a database on a Web Cloud Databases server, the server name can be retrieved from the tab
General information
{.action}, in the boxLogin information
{.action} underSQL
{.action} and labelled asHost name
{.action}.
Having a Web Cloud Databases server allows you to connect to your databases from your computer or a server outside of the OVHcloud infrastructure.
If this connection is not possible, first check that you have authorized your public IP address connected to the database server.
If this operation has been carried out, contact your ISP or the OVHcloud partners. We will not be able to assist you in this situation.
Getting started with Web Cloud Databases
Resolving the most common 1-click module errors
For specialised services (SEO, development, etc.), contact OVHcloud partners.
Join our community of users.