With a Private SQL server you get your own database server safe in the knowledge that your servers are 100% managed by the teams at OVH. Your resources are your own and they are not shared.

The size of the database is unlimited which means that you can choose the best configuration between data volume and SQL server performance.

Overview

What is the private SQL solution?
With a Private SQL server you get your own database server safe in the knowledge that your servers are 100% managed by the teams at OVH. Your resources are your own and they are not shared.
  • Private SQL servers require a shared web hosting plan.
Advantages of Private SQL
  • Unlimited database size (limited to the space available on the server)
  • Between 100 and 200 concurrent connections
  • Choose and change your version of SQL at any moment
  • Adapt MySQL configuration according to your needs
  • Create privileged accounts which can access several databases
Enjoy unlimited resources
With a private SQL server, your resources are your own and they are not shared, as they would be on shared servers.

This means that whatever you do, you will not inconvenience other users. The size of the database is unlimited. Thus, you can choose the best configuration between data volume and SQL server performance.
Choose your version of SQL
You can choose the SQL version when you order from a list of available versions.
If you want to change the version at a later date you can do so in one click from your customer account, as long as it is available.
Back up your data automatically from your control panel.
You can automate database backups in just a few clicks! You can also run updates safe in the knowledge that you can easily recover your backups in the event of a problem.

Just activate the service directly via your OVH control panel.
How it works
Your Private SQL has its own resources (processors, RAM etc.) which are designated by the main system, so that users don't inconvenience each other.

Manage my Private SQL service

.

Activate my free Private SQL

If you have Performance hosting, you can activate a Private SQL 128 MB RAM server for free. To enable it you just have to go to your customer account and click on the name of your performance hosting package.
If there is currently no Private database associated with your server just click on "Enable"
You then click "Confirm" and after a few minutes it will be activated.
.

Configure my Private SQL sever

To configure your Private SQL server, click on the Private SQL server concerned under "Hosting" (1) then go to the "General information" tab (2). Next click on "Change the amount of RAM"(3) to access the screen where you can select the RAM you need.
Choose the RAM size you need and then click "Next".
You then have to select a duration between 3,6 and 12 months.
If you have a few months left before your server expires the amount to pay will be prorated. The pro rata rate will be based on the expiration date of the server.
You then have to accept the terms and conditions by ticking the box "I confirm having read and fully understood the terms and conditions." and then clicking "Next".
Finally you will get summary of your order and if you are happy just click "Confirm".
  • You will be redirected to the purchase order to settle this order. Your modifications will take effect in a few hours.
If you change your offer away from Performance hosting your Private SQL server will no longer be free.

Create my database and my users

.

Create a user

  • To use a Private SQL server you have to create users with specific rights enabling them to access a database.

To do this go to the "Users and rights" tab(2) and click on "Add user" (3).
Once you have provided a username (1) and password (2) click "Confirm" (3).
A message will appear in your customer account explaining that the request to add a user has being processed.
  • You will be able to see in the "Users and Rights" tab that a user is being added. This may take several minutes because information is not synchronised in real time. You may need to click on "Synchronise information" to refresh the information (5 to 10 minutes after the information is visible).
.

Create a database

To create a database, click on the name of your server in the left-hand column (1), then click the "Databases" tab (2) and finally click "Adding a database" (3).
You then have to enter a Database name (1) which meets the stated conditions and then click "Confirm" (2).
A message will appear in your customer account explaining that the request to add a user has being processed.
  • This may take several minutes because information is not synchronised in real time. You may need to click on "Synchronise information" to refresh the information (5 to 10 minutes after the information is visible).
.

Delete a database

To delete a database from your Private SQL server you have to go to the "Databases" tab (2) and click the cogwheel to the right of your database and click on "Delete the database" (3).
When deleting a database no checks are carried out on the content. The content of the database will therefore be deleted even if data is still stored there. We therefore recommend that you perform a backup before deleting it.
Finally just click confirm.
  • A message will appear to say that the database is being deleted. This may take several minutes because information is not synchronised in real time. You may need to click on "Synchronise information" to refresh the information (5 to 10 minutes after the information is visible).

Use my databases

.

Manage user rights

To manage the rights of each user, go to the "Users and rights" tab.

Then click on the cogwheel next to the relevant user and then click "Manage rights".
In the left-hand column you will find the list of databases on your Private SQL server.

  • The following rights can be assigned:

  • Read/Write: The user can run queries such as SELECT, DELETE, UPDATE for example.

    Read: The user can only run SELECT queries.

    None: The user has no rights on the database.
Modifying user rights can take a few minutes.
.

Log into a Private SQL database

You will find the link to access your database in General Information under "Database administrator".
The link takes you to the phpMyAdmin page.

1. Server: You have to enter the name of your server.

For "Legacy" servers, you have to enter your server's IP address.

2. User: This is the username defined in the "User and rights" tab in your customer account.

3. Password: Enter user password.

4. Port: You can find the port number under the "General information" tab in your customer account.
You can find the name of the server and the port number in your customer account under "SQL connection"
If the connection is successful, the phpMyAdmin page will appear .
In the event of a 1045 error
If the following error message appears (#1045) it means the user details were incorrect. You need to double check your details.
In the event of a 2005 error
If you get a #2005 error, you should check the name of the server and make sure this is working

Back up, import, restore

.

Back up a database

To back up your database, go to the "Databases" tab then click on the cogwheel next to your database. Finally click "Back up now".
It will take a few minutes to back up.
Backups are kept for 30 days, after this, they are deleted automatically.
.

Plan database backups

To plan automatic backups on your Private SQL server, the first step is to go to the "Databases" tab, click on the cogwheel next to your database and select "Plan backups".
You can then choose to activate email notification.
For step two you have to select the task's frequency.
Step 3 let's you double check the task summary.
You can view the list of planned backups in the "Planned backups" tab.
.

Download a backup

To download a backup, you have to click on the number displayed in the "Backups" column. This number represents the number of backups available for this database.
The list of available backups will appear. Just click on the floppy disk icon to download the backup.
.

Restore backup

To restore a backup, you have to click on the number displayed in the "Backups" column. This number represents the number of backups available for this database.
The list of available backups will appear. Just click on the download icon to download the backup.
Restoring a backup will take a few minutes, the time it takes will depend on the size of the chosen backup.
.

Export a MySQL database from phpMyAdmin

To export your database directly from phpMyAdmin you have to sign in to the interface as explained above.

Click on the name of the database that you want to export and then click "Export".
There are two exportation methods. If you don't have any specific needs, we suggest that you use the quick mode in SQL format.
.

Import a MySQL database from phpMyAdmin

To import your database directly from phpMyAdmin, you have to sign in to the interface as explained above.

Once you are in PhpMyAdmin, select your database by clicking on its name.

Then click "Import".

Select the file to back up by clicking on "Browse" (Please note that the file must not exceed 128 MB).

Click on "Go" to begin the import.
.

How to export my database via the Command Line?

  • Export (Docker) :
  • mysqldump --host=sql_server --user=database_name --port=Port --password=password database_name > database_name.sql

  • Export (Legacy) :
  • mysqldump --host=sql_server
    --user=database_name
    --password=password database_name > database_name.sql
.

How to import my database via Command Line?

  • Import (Docker) :
[code]cat database_name.sql | mysql
--host=sql_server --user=database_name
--port=port --password=password
database_name/[code]

-Import (Legacy) :
[code]cat database_name.sql | mysql
--host=sql_server --user=database_name
--password=password
database_name/[code]
.

How to export my database from a PHP file?

  • Export (Docker) :
  • <?
    echo "Performing database backup......"
    system("mysqldump --host=sql_server --user=database_name --port=Port --password=password database_name > database_name.sql");
    echo "Done. You can retrieve the database via FTP";nd
    
    ?>

  • Export (Legacy) :
  • <?
    echo "Performing database backup.......";
    system("mysqldump --host=sql_server --user=database_name
    --password=password database_name > database_name.sql");
    echo "Done. You can retrieve the database via FTP";
    ?>
.

How to import my database from a PHP file?

  • Import (Docker) :
  • <?php
    echo "Your database is being restored.......
    <br>";
    system("cat database_name.sql | mysql --host=sql_server --user=database_name --port=Port --password=password database_name");
    echo "Done. Your database is not on your hosting package.";
    ?>

  • Import (Legacy) :
  • <?php
    echo "Your database is being restored.......
    <br>";
    system("cat database_name.sql | mysql --host=sql_server --user=database_name 
    --password=database_name");
    echo "Done. Your database is not on your hosting package.";
    ?>

Modify my Private SQL server configuration

.

Legacy server

Got to this link if you need help deciding the type of Private SQL server.
FTP connection to a Private SQL server
  • Net2Ftp

To connect in FTP to your Private SQL "Legacy" server via Net2FTP, click on the following link:

http://sqlprive.ovh.net/ftp

In the username field, enter the name of the Private SQL server. Then enter the "FTP" password. If you leave the Initial directory field empty you will arrive at the root of your FTP space.
  • Connect via the FTP client (Filezilla)

Use sqlprive.ovh.net for the Host, for the username enter your Private SQL reference in the following form: sqlprive-XXXX-0XX, then enter your password.
Modify FTP password
You can change your Legacy Private SQL server's FTP password by going to the "General information" section and then clicking on "Change the password".

You then have to restart your server, the modification will take a few minutes.
Configure my.cnf file
To modify the my.cnf file on old SQL Private Legacy servers, you have to connect in FTP then edit the file concerned.
Once the changes have been made, save the file and then restart it.

To restart it, you first have to click on "Stop" (this may take a few moments), and then click "Start" to start up your server.
.

Docker server

You need to go to the "Configuration" tab. In the "General MySql configuration" box, you will find the current configuration defined in the my.cnf file. You can change this by clicking on "Edit".
Perform the necessary changes and then click "Confirm".
Warning!
Any changes you make require the server to be restarted.

Optimise my sever

.

Access sever logs

What are Slow Logs?
These logs contain SQL queries which are too slow.

  • Legacy servers:
To get these sort of logs, you have to add the following lines to the my.cnf file:

slow_query_log = 1
slow_query_log_file = /home/mysql/slow.log
You can find your Private SQL server logs in the sqlprive.log file which can be found in the directory /home/mysql of your Private SQL FTP/

We suggest that you empty or delete this file regularly to avoid overloading your Private SQL for no reason.

  • Docker server:
To get these types of logs, you have to retrieve them at the root of your FTP server of the private sql docker server by connecting in SFTP.
.

Optimise your database

You have to maintain your database to ensure it continues to perform. Performance can be understood as the speed at which database content is returned to the script which has requested it.

To ensure a speedy response, the database must be structured and optimised. We are now going to look at how to optimise your database.
Index the database
To increase the speed at which requests are answered, you have to index the fields which are used in WHERE clauses.

For example: You often search for a person by town. You have to index the field "town" with the following request:

ALTER TABLE `test` ADD INDEX ( `town` );
Purge the database
If there is some data which you no longer use, why not archive it? Your tables will use less space and it will take less time to query the database.
Display limit
Limit the number of records displayed (eg 10 per page) with the LIMIT part of your SQL query.
Order your requests
Order your requests at the beginning of the script in this way:

open_connection
request1
request2
...
close_connection
Display...
Treat data
Loop through data...
Display...
...
Optimise your database by using cache
If there are elements in your database which do not change, you should cache them.

Following this tip will drastically diminish the need to access your database and speed up your site's load time.

You can also perform session cache.
Put query results into a session variable. This means that you do not need to run an identical query next time, you can just retrieve the session variables instead.
Only recover the data which is used
In your SQL requests, make sure you select only what you need, and that you have not forgotten the links between the tables.

Example:

(where table1.champs = table2.champs2)
Avoid resource intensive options
Avoid using the "HAVING" clause which can slow down requests. You should also avoid using "GROUP BY", unless strictly necessary.
.

Change MySql version

In order to check which MySQL version is running on your Private SQL server, select your private server and then go to the "General information" tab.

  • The current version will be displayed on the "Version" line.

To change this version, just click "Modify version".
  • Before migrating to a higher version, make sure that your database is compatible with the chosen version,
  • The modification will take effect in a few minutes.
If you are already using version 5.5 you cannot alter this because this is latest MySQL version.

FAQ

.

Is my Private SQL server a "Legacy" or "Docker" server?

  • Old Private SQL servers are Legacy servers (eg: sqlprive-kx11111-009) and new ones are Docker servers (eg. sx11111-012) They are two different infrastructures.
.

Why do I get a data error with my private SQL server?

  • This is an official problem with version 5.1.31 of Mysql. To correct this you need to switch to version 5.5.14
.

Can I connect to my Private SQL server as Root?

  • You can only do this on private SQL Legacy servers.
.

How do I know how big my database is?

  • The size of your database is displayed in the "Databases" tab in the "Used space" column.
.

How do I delete a database or user?

  • You just have to go to the "Users and rights tab" or the "Databases" tab, click on the cogwheel and then click "Delete".
.

How do I find out how much RAM has been used?

  • For Private SQL Docker servers you can find this information in the "Metrics" tab in your customer account.
  • However you cannot access this information for "Legacy" servers.
.

How do I view my server logs?

  • You cannot currently view this information from your customer account but soon you will be able to.
.

Can I setup a CRON job to restart my Private SQL server?

  • We do not currently offer this service.
.

Can I duplicate a database?

  • You cannot currently do this in your customer account.
.

Are my backups stored on my Private SQL server?

  • Your data backups are not stored on your Private SQL server which means that none of your space is used. In addition, your backups are retained on our system for 30 days.
.

Why do I get a "Too many connections" error for my website?

  • You get this message because you have exceeded the amount of concurrent connections on your Private SQL database.
You can increase the "MaxConnections" number by modifying your servers.