MySQL databases

Plans from Standard upwards include MySQL databases. You create and manage them from the control panel, browse them in phpMyAdmin, and connect to them from your own scripts on localhost.

Create one

On the dashboard, under Databases, type a short name — lower-case letters, digits and underscores — and press Create. Within a minute you have:

Database
ssu_yourname_thename
Username
the same string
Password
shown once, on the page, when you create it
Host
localhost

Copy the password before you navigate away. It is generated for you, shown once, and never stored anywhere it can be read back — not by staff either. If you lose it, press New password next to the database and a new one is generated the same way. That is not an inconvenience we forgot to fix; a password that can be shown again is a password somebody else can be shown too.

Connect from your own code

PHP, in a page under ~/public_html:

<?php
$db = new PDO(
    'mysql:host=localhost;dbname=ssu_yourname_site;charset=utf8mb4',
    'ssu_yourname_site',
    'the-password-you-copied',
    [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
);

From the shell:

mariadb -u ssu_yourname_site -p ssu_yourname_site

Keep the password out of ~/public_html. A config file one directory up, included by your pages, is enough — the web server serves what is inside public_html and nothing above it.

phpMyAdmin

At /phpmyadmin. Log in with the database username and password, not with your panel login — they are separate accounts for separate things.

You will see your own database and nothing else. That is MariaDB enforcing its own grants rather than phpMyAdmin hiding things: your database user has privileges on exactly one schema, so there is nothing else for it to list.

Limits

Your plan sets how many databases you may have and how large each may be; the dashboard shows both with a bar. Size is measured once a minute, so it lags slightly.

Nothing currently stops you from exceeding the size allowance — the number is there to be watched rather than enforced. Sitting well over it is the sort of thing staff will ask you about rather than something the system will do for you quietly.

Deleting

The dashboard has a delete form that asks you to type the name twice. It drops the database, its MySQL user and everything in the tables.

There is no backup to restore from yet. If the data matters, take your own dump before you delete anything — and, honestly, on a schedule too:

mkdir -p ~/backups
mariadb-dump -u ssu_yourname_site -p ssu_yourname_site > ~/backups/site-$(date +%F).sql

A cron line does the same thing while you are asleep. Deleting your account removes its databases too, in the same sweep.

« All guides