Databases
A database stores structured website information. WordPress uses MySQL or MariaDB for pages, posts, users, settings, comments and much of the information created by plugins. Images and plugin or theme code remain in the website files.
How WordPress connects
The wp-config.php file contains the database name, username, password and host used by WordPress. The configured table prefix identifies the tables used by that installation. Read The WordPress Configuration File before changing it.
What the database contains
- Pages, posts, comments and other written content.
- User accounts, roles and profile information.
- WordPress settings, menus and site configuration.
- Information created by plugins, such as form entries, orders or SEO settings.
Make changes safely
- Confirm the correct site and database before opening an administration tool.
- Create a database backup and keep it outside the live hosting account.
- Use a WordPress-aware tool for search and replace because some saved values contain structured data.
- Change only the intended rows or settings, then test login, pages, forms and other important features.
If WordPress cannot connect to its database, follow MySQL Common Issues.
Common questions
Frequently Asked Questions
Does a database backup include my images?
No. Media files are normally stored under wp-content/uploads. Use a full-site backup when you need both the database and website files.
Where are the WordPress database details stored?
They are usually defined in wp-config.php in the main WordPress directory.
Can I open the database from WordPress admin?
WordPress does not include a general database editor. Hosts often provide a separate tool, while developers may use WP-CLI or another database client.
Why should URL replacements use a WordPress-aware tool?
WordPress and plugins can store structured or serialised values. A basic text replacement may damage that data, while a suitable tool updates it correctly.