--- title: MySQL / MariaDB description: Relational databases where CMS platforms store content, users, and settings — separate from theme files in the document root. canonical: https://penasihathosting.com/en/hosting-wiki/mysql type: wiki locale: en updated: 2026-07-15 author: Willya Randika --- # MySQL / MariaDB ## Overview - **Summary:** Relational databases where CMS platforms store content, users, and settings — separate from theme files in the document root. - **Author:** Willya Randika ([profile](/penulis/willya-randika)) ## Article **MySQL** (and its close cousin **MariaDB**) is a relational database used to store structured data: WordPress posts, store users, orders, theme options, and more. On hosting, the database is almost always separate from HTML/PHP files — the app *connects* with a host, database name, user, and password. Without a database, a dynamic CMS will not run even if theme files look fine. That is why “files only” backups cannot fully restore a shop or blog. ## A Simple Analogy Files in the [document root](/en/hosting-wiki/document-root) are brochure racks. The database is a **labeled filing cabinet**: data can change without reprinting the whole rack. Dropping the cabinet leaves empty shelves that look “broken.” ## Terms You Will See | Term | Short meaning | | --- | --- | | **Database** | The data container | | **DB user** | Account allowed to access the DB (not your cPanel user) | | **Host** | Often `localhost` on shared hosting | | **phpMyAdmin** | Browser UI for tables ([article](/en/hosting-wiki/phpmyadmin)) | | **Table prefix** | e.g. `wp_` on WordPress | In [cPanel](/en/hosting-wiki/cpanel): **MySQL Databases** creates DBs/users and assigns privileges. ## Safe Habits - Never commit DB passwords to Git or public repos - Prefer one database per app for cleaner isolation - Back up databases **separately** from files ([backups](/en/hosting-wiki/backup-hosting)) - Grant each DB user only the databases it needs - After migrations, align `wp-config.php` or env vars with the new credentials ## Performance and Resources Slow queries hold PHP and can contribute to [Error 508 / EP](/en/hosting-wiki/entry-processes-ep). Missing indexes, heavy plugins, and cron jobs pounding large tables are common suspects. Watch database size: shared plans often cap DB count or storage. ## What to Watch For - Do not leave phpMyAdmin open to the world without protection - MySQL/MariaDB versions differ across hosts — test plugins before migrating - Large imports may time out in the UI; keep SSH/CLI as a fallback - Table prefixes help when multiple apps share one DB (still not ideal) ## FAQ On shared hosting the provider chooses. Both work for WordPress and common apps. Match whatever your host supports. Content, users, and settings live in DB tables — not static files alone. Sometimes via remote MySQL (host must allow your IP). Many shared plans only allow `localhost` from inside the server. Check quotas, credentials, user privileges, and whether the DB service is up. App error logs usually give the first clue.