Databases questions
10 short answers about databases. Each one links on to the full article and, where there is one, a step-by-step tutorial.
- How do I create a MySQL database?
In DirectAdmin open Account Manager then MySQL Management and create the database along with a user, then note the database name, username and password. Your application needs all three plus the host, which is
localhost. - How do I import a database?
Use phpMyAdmin: create an empty database first, open it, then use the Import tab to upload your
.sqlfile. If the file is too big to upload, compress it as.gzor split it. - How do I export or back up a database?
Open the database in phpMyAdmin and use the Export tab — the quick method produces a
.sqlfile you can download and keep. Do this before any upgrade or migration. - What is phpMyAdmin?
phpMyAdmin is a web interface for looking inside your MySQL databases — browsing tables, running queries, importing and exporting. It is included with your hosting and opens from Extra Features then phpMyAdmin in DirectAdmin.
- What does “Error establishing a database connection” mean?
Your site’s configuration file has the wrong database name, username, password or host. Check all four against what DirectAdmin shows, remembering the account prefix on the database name, and use
localhostas the host. - What is MySQL and why does my site need it?
MySQL is the database that stores everything your site does not keep in files — posts, pages, users, settings, orders. WordPress and most other applications keep their content there, which is why a backup of your files alone is not a complete backup.
- What’s the difference between MySQL and MariaDB?
MariaDB is a drop-in replacement for MySQL created by its original developers. For anything you will run on shared hosting they behave identically, and software written for MySQL works on MariaDB without changes.
- How do I change a database password?
Change it for the database user in Account Manager then MySQL Management, then immediately update the same password in your application’s configuration file —
wp-config.phpfor WordPress. The site goes down the moment the two stop matching. - My database is too big to import — what do I do?
Upload it compressed as a
.gzor.zip, which phpMyAdmin can import directly and which is often enough on its own. If it still fails, split the file into several smaller ones and import them in order. - What does “Access denied for user” mean?
The database username or password is wrong, or that user has no rights on that database. Check all three against DirectAdmin, remembering that database and usernames carry your account prefix — a missing prefix is the single most common cause.
Need more than a quick answer?
The knowledge base covers databases in full detail, with the background and the edge cases these answers deliberately leave out.
Questions on other topics
All questions- Getting started (13)
- Hosting explained (23)
- DirectAdmin (8)
- Domains (17)
- DNS (18)
- Email (21)
- Email deliverability (8)
- SSL & HTTPS (13)
- WordPress (25)
- Forums & communities (2)
- Online shops (2)
- PHP (9)
- Files & FTP (11)
- Developer tools (12)
- Performance (14)
- Security (13)
- Backups & recovery (7)
- Troubleshooting (26)
- Account & billing (14)