This guide explains how our MySQL and PostgreSQL PaaS DB services work.

View the services on our website: MySQL PaaS DB

Overview

.

Beta version

This service is currently in the Beta phase.
As this service is currently in Beta, we cannot provide support for this service.
However you can contact our technical teams on our mailing list.
  • To subscribe: paas.sql-subscribe@ml.ovh.net
  • For assistance: paas.sql@ml.ovh.net
.

What is the PaaS DataBase service?

The MySQL and PostgreSQL PaaS DB service was designed for specific and significant database requirements and it provides access to your databases with a public IP.

A PaaS Database instance gives you your own database instance, safe in the knowledge that your server is managed by OVH. We provide resources dedicated exclusively to you.
Please note: this service is not compatible with our shared web hosting packages.
.

The advantages of the PaaS Database

  • Unlimited database size (the size is limited to the amount of disk space available on the instance)
  • 100 concurrent connections possible (soon this number will rise to 200)
  • Possibility to migrate to a higher version of MySQL or PostgreSQL if it is available (coming very soon)
  • Ability to configure an instance according to your needs (coming very soon)
  • Ability to create privileged accounts which can access several databases
  • Server info managed by OVH
  • Security thanks to IP whitelisting

Manage your PaaS Database service

.

Where to manage your PaaS DataBase service

Once you have created the instance, you will see the following information:
  • Project name: The name of the project. You can change this
  • Status: The status of your project, make sure that it is in "Created"
  • Creation: The project creation date
  • Modification date : The date when your project was last modified
.

Create an instance

In order to use your service, first of all you have to create an instance.
  • To do so, click on the "New instance button.
  • Fill in the required fields:

  • Instance name:
Choose a name for your instance
Region: Select the geographic location of your instance
Image: Select the MySQL/PostgreSQL version of your instance
Offer: Select your service

  • Then click on "Add instance".
.

About your instance

  • Once you have created your instance, you can view the following information:
  • Make sure that the status of your instance is "Running", which means that it is working.

  • You can also see different icons on the right:
  • Click on the "details" icon to access additional information about the instance.
  • The following information will then appear:
  • Instance name: The name of your instance. You can modify this
  • Status: The status of your instance, make sure that it is in "Running" mode
  • Creation date: Your instance creation date
  • Modification date: The date when your instance was modified
  • URL: Your instance's address
  • Service port: The port used to connect to your instance
  • SFTP port: The port used to connect to your SFTP server
  • Offer: The name of your service
  • Image: The SQL version
  • Region: The geographic location of your instance
  • RAM: Your instance's memory capacity
  • Storage: The storage space available on your instance

Create your database and your users

.

Create a database

  • Click on "Add a database".
  • Enter a "name" for your database then click "Create".
.

Create a user

To use a PaaS Database instance, you have to create users with specific rights for accessing a database.

  • Click on "Add a user".
  • Enter a username then click "Add".
.

Manage users

  • You will then be able to view the account information for the account that has been created.
  • Then click on "Add a right".
Choose:
  • the database
  • the user
  • the level of rights that you want to assign, then click "Add".
The different rights that you can choose are:
  • None: No rights on the chosen database
  • RO: Read only (The user can only run SELECT queries.)
  • RW: Read write
(The user can run SELECT, INSERT, UPDATE, DELETE queries.)
  • ADMIN: Administrator rights (The user can run SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP queries)

  • You will then be able to see that your user has the appropriate rights for their database.

Manage IP authorisation

.

Add an IP

In order to make your database accessible, you have to specify which IPs are authorised to connect to your instance.

  • Click on "Add an authorisation".
Fill in the following boxes:

  • IP: IP address or range of IPs which should access the instance
  • Description: Add a description for this IP
  • Service: Authorise or disallow this IP from connecting to the database instance
  • SFTP: Authorise or disallow this IP from connecting to the SFTP server

  • For an IP:
  • For an IP range:
  • Then click on "Add" to confirm your configuration.

Export and import a ySQL database

.

How do I export my database via the Command Line?

  • Export:
  • mysqldump --host=server --user=database_name --port=Port --password=password database_name > database_name.sql
.

How do I import my database via Command Line?

  • Import :
  • cat database_name.sql | mysql
    --host=server --user=database_name
    --port=Port --password=password
    database_name
.

How do I export my database from a PHP file?

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

How to import my database from a PHP file?

  • Import :
[code]<?
echo "Your database is being restored.......
<br>";
system("cat database_name.sql | mysql --host=server --user=database_name --port=Port --password=password database_name");
echo "Done. Your database is on your SQL server.";
?>

Export and import a PostgreSQL database

.

How do I export my database via the Command Line?

  • Export:
  • pg_dump --host=server --port=5432 --username=user --password=password database_name > database_name.sql
.

How do I import my database via Command Line?

  • Import:
  • psql --host=server --port=5432 --username=username --password=password < database_name.sql
.

How do I export my database from a PHP file?

  • Export:
  • <?
    echo "Performing database backup......"
    system("pg_dump --host=server 
    --port=5432 --username=username
    --password=paassword database_name > database_name.sql");
    echo "Done. You can retrieve the database via FTP";
    ?>
.

How to import my database from a PHP file?

  • Import :
  • echo "Your database is being restored.......
    <br>";
    system(psql --host=server --port=5432
    --username=username
    --password=password database_name < 
    database_name.sql");
    echo "Done. Your database is on your
    SQL server.";
    ?>