MySQL for your PHP projects

Create a database from your project settings and connect from PHP. Each project can have one MySQL database with its own credentials.

When you need a database

Use MySQL when your application needs to keep records between requests: form submissions, catalogue items or notes. PHP handles the request and queries the database; the browser receives the result.

The project owner creates the database and reads its generated name, user and password in the dashboard. Copy those exact values into your server-side configuration.

How to publish it

  1. Create a PHP project

    Start with a project in your dashboard and upload a PHP entry file you can test.

  2. Create the project database

    As the project owner, use its database action. One provisioned database is supported per project.

  3. Use the generated credentials

    Copy the database name, user and password into server-side configuration. Use the exact values, not the project slug as a guess.

  4. Test before adding application tables

    Check the connection with a small query, then create your application schema and use prepared statements for user input.

Example file

database-check.php
<?php
$pdo = new PDO(
    'mysql:host=localhost;dbname=YOUR_DATABASE;charset=utf8mb4',
    'YOUR_DB_USER',
    'YOUR_DB_PASSWORD',
    [
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
        PDO::ATTR_EMULATE_PREPARES => false,
    ]
);
echo $pdo->query('SELECT 1')->fetchColumn();

Example only — replace placeholders before using it.

Before you upload

See all hosting limits

Common questions

Can collaborators retrieve credentials from the dashboard?

The database credential action is owner-only. Plan team access carefully and keep secrets in server-side configuration.

Does this also provision PostgreSQL or MongoDB?

No. The database provisioning described here is MySQL. Do not assume a different database engine is available.

Do I need a database for an HTML portfolio?

Usually not. If the site only serves HTML, CSS, JavaScript and images, static hosting is the simpler starting point.

Useful guides