Create a database and user for WordPress or your own website, then connect to it using the details DirectAdmin gives you.
Open the control panel address from your welcome email. It ends in :2222, for example yourdomain.co.uk:2222. Enter your username and password, then click Sign in.
On the home page, find the Your Account section and click MySQL Management.
You'll see any databases you already have. Click Create new Database at the top left.
The phpMyAdmin SSO button on this page opens phpMyAdmin without a password, for when you need to import or browse your data later.
shop. Your account username is added to the front automatically, so it becomes yourusername_shop.shopuser. It also gets your username added to the front. If you already have a user, you can pick it from select existing user instead.Click Create.
DirectAdmin shows the full database name, username and password. Copy the password now and keep it somewhere safe, as you'll need it for your website's settings.
The Host box is left blank on this screen. Use localhost.
localhost. Your real password shows in its place.Enter these in WordPress's installer, your wp-config.php, or your own site's config file.
| Setting | Value |
|---|---|
| Host | localhost |
| Port | 3306 |
| Database name | yourusername_shop |
| Username | yourusername_shopuser |
| Password | The one you copied in step 5 |
If localhost gives a connection error, try 127.0.0.1 instead. Always use the full names with your username at the front.
For your own PHP code, a connection looks like this:
$db = new PDO(
'mysql:host=localhost;dbname=yourusername_shop;charset=utf8mb4',
'yourusername_shopuser',
'your-password'
);