> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Manage MySQL Databases

> Learn how to create, manage, and connect to MySQL databases in the FREAKHOSTING Web Hosting Control Panel for your websites and applications.

## Managing MySQL Databases for Your Website

MySQL databases are the backbone of most modern websites. They store all of the dynamic content your site relies on — blog posts, user accounts, product listings, form submissions, settings, and more. Nearly every popular web application, including WordPress, Joomla, and WooCommerce, requires at least one MySQL database to function. The FREAKHOSTING Web Hosting Control Panel makes it easy to create and manage databases directly from your browser.

<CardGroup cols={2}>
  <Card title="Difficulty" icon="gauge-low">
    Intermediate
  </Card>

  <Card title="Time" icon="clock">
    5 Minutes
  </Card>
</CardGroup>

***

## When Do You Need a Database?

If you are new to web hosting, you might be wondering whether you actually need a database. Here is a simple way to think about it:

**You need a database if your website stores or displays content that changes.** A plain HTML page with static text and images does not need one. But the moment your site needs to remember things — like user logins, blog posts, product inventory, or form submissions — a database is required.

<CardGroup cols={2}>
  <Card title="You Need a Database For" icon="check">
    WordPress, Joomla, or any CMS. Online stores (WooCommerce, PrestaShop). Forums, membership sites, or booking systems. Any app with a login system or search feature.
  </Card>

  <Card title="You Don't Need a Database For" icon="xmark">
    A simple HTML/CSS portfolio page. A static landing page with no forms. A site built entirely with static files and no backend logic.
  </Card>
</CardGroup>

If you are installing WordPress or any similar application, the installer will ask you for database details. That is your cue — you need to set one up here first.

***

## Accessing the Databases Section

<Steps>
  <Step title="Log In to the Web Hosting Control Panel">
    Navigate to [https://web.freakhosting.com](https://web.freakhosting.com) and sign in with the credentials provided in your welcome email.
  </Step>

  <Step title="Open the Databases Tab">
    Click on **Databases** in the top navigation bar. This section is where you create and manage all MySQL databases and database users associated with your hosting account.
  </Step>
</Steps>

If this is your first time here, you will see an empty state with a database icon and the message **"No databases or users"** along with the text: *"Add MySQL databases with users that have different levels of access."* Two buttons are available: a teal **Add database** button and an outlined **Add user** button.

<Info>
  If you do not see the **Databases** tab, your hosting plan may not include MySQL database access. Please check your plan details or contact support for assistance.
</Info>

***

## Real-World Example: Setting Up a Database for WordPress

Before diving into the individual steps, let's walk through a complete, real scenario. Say you just purchased hosting and you want to install WordPress. Here is exactly what you would do:

1. Go to the **Databases** tab and click **Add database**. Name it something like `wordpress` (the panel may prefix it with your account name, making it something like `fh_wordpress`).
2. Click **Add user**. Create a user called `wpadmin` with a strong password like `G7$kLm9!pQx2`. The panel may prefix this too, giving you `fh_wpadmin`.
3. Assign the `fh_wpadmin` user to the `fh_wordpress` database with **All Privileges**.
4. Head to your dashboard and find the **MySQL IPv4 Address** in the **At a Glance** panel (for example, `191.96.94.5`) — click the copy button next to it.
5. When the WordPress installer asks for your database details, enter:
   * **Database Name:** `fh_wordpress`
   * **Username:** `fh_wpadmin`
   * **Password:** `G7$kLm9!pQx2`
   * **Database Host:** `191.96.94.5`

That is it. WordPress connects, creates its tables, and you are up and running. The steps below break down each part in more detail.

<Tip>
  Write down your database name, username, and password somewhere safe before starting your app installation. You will need all three, and there is nothing worse than having to reset credentials mid-setup.
</Tip>

***

## Creating a New Database

<Steps>
  <Step title="Click Add Database">
    On the Databases page, click the teal **Add database** button.
  </Step>

  <Step title="Enter a Database Name">
    Type a name for your new database. Choose something descriptive that helps you identify what the database is used for (e.g., `wordpress`, `shop`, or `blog`). The system will automatically add a prefix based on your account name, so `wordpress` might become `fh_wordpress`.
  </Step>

  <Step title="Confirm Creation">
    Click **Save** or **Create** to finish. Your new database will appear in the list immediately.
  </Step>
</Steps>

<Tip>
  Use short, lowercase names without spaces or special characters for your databases. This makes them easier to type when configuring applications and avoids compatibility issues. Good examples: `wordpress`, `store`, `myapp`. Bad examples: `My Website DB!`, `test 123`.
</Tip>

***

## Creating Database Users

A database on its own is like a locked room with no key. You need to create a **database user** and assign it to the database before anything can actually read or write data inside it.

### What Are Database Users and Privileges?

Think of it this way: the **database** is a filing cabinet, and a **database user** is a person with a key. **Privileges** determine what that person is allowed to do — just read the files, add new ones, edit existing ones, or throw everything away and start over.

Here are the common privilege levels you will encounter:

| Privilege          | What It Means                                                                                                                                         |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **All Privileges** | Full access — read, write, create tables, delete data, everything. Use this for apps like WordPress that need to manage their own database structure. |
| **Read Only**      | Can view data but cannot change anything. Useful for reporting tools or backup scripts.                                                               |
| **Read/Write**     | Can view and modify data, but cannot change the database structure itself.                                                                            |

For the vast majority of web applications (WordPress, WooCommerce, Joomla, etc.), you want **All Privileges**. When in doubt, grant all privileges to the user for its own dedicated database.

### Creating a User Step by Step

<Steps>
  <Step title="Click Add User">
    On the Databases page, click the outlined **Add user** button.
  </Step>

  <Step title="Set a Username">
    Enter a username for the new database user. Keep it short and descriptive, like `wpadmin` or `shopuser`. The system may add a prefix automatically (e.g., `fh_wpadmin`).
  </Step>

  <Step title="Set a Strong Password">
    Create a strong password for the user. Use a mix of uppercase letters, lowercase letters, numbers, and symbols — something like `G7$kLm9!pQx2`. Many applications will require you to enter this password later during setup, so save it somewhere secure.
  </Step>

  <Step title="Assign Access and Privileges">
    Select which database(s) this user should have access to, and choose the appropriate privilege level. For most website applications like WordPress, granting **All Privileges** to the user on its designated database is the correct choice.
  </Step>

  <Step title="Save the User">
    Click **Save** or **Create** to finalize the new database user. Make a note of the username and password — you will need them when configuring your website or application.
  </Step>
</Steps>

<Warning>
  Keep your database passwords stored securely. If someone gains access to your database credentials, they can read, modify, or delete all of the data in your database. Never share credentials over unencrypted channels like plain-text email.
</Warning>

***

## Managing Existing Databases

Once you have created databases and users, you can manage them at any time from the **Databases** page.

<CardGroup cols={3}>
  <Card title="View Databases" icon="database">
    All of your databases are listed on the Databases page with their names and associated users.
  </Card>

  <Card title="Manage Users" icon="users">
    Click on a database or user to update passwords, change privilege levels, or reassign users to different databases.
  </Card>

  <Card title="Delete" icon="trash">
    Remove databases or users you no longer need. Deleting a database permanently erases all data stored inside it.
  </Card>
</CardGroup>

<Important>
  Deleting a database is **permanent and irreversible**. Always create a backup of your data before removing any database. There is no way to recover a deleted database once it has been removed.
</Important>

***

## Connecting Your App to the Database

When configuring a website or application, you will need to provide your database connection details. Here is where to find each piece of information:

| Detail                            | Where to Find It                                                                                                                                              |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Database Host / MySQL Address** | Shown on the control panel dashboard under the **At a Glance** section as the **MySQL IPv4 Address** (e.g., `191.96.94.5`). Click the copy button next to it. |
| **Database Name**                 | The name you chose when creating the database, visible on the Databases page (including the prefix).                                                          |
| **Database Username**             | The username you created for the database user (including the prefix).                                                                                        |
| **Database Password**             | The password you set when creating the database user.                                                                                                         |

<Note>
  Use the **MySQL IPv4 Address** shown on your dashboard — not `localhost`. Because your database server may be hosted separately from your web server, using the correct IP address ensures a successful connection.
</Note>

### Example: WordPress wp-config.php

If you are configuring WordPress manually (rather than using the web installer), you would edit the `wp-config.php` file with your database details. The relevant section looks like this conceptually:

```php theme={null}
// ** Database settings - You can get this info from your web host ** //

/** The name of the database for WordPress */
define( 'DB_NAME', 'fh_wordpress' );

/** Database username */
define( 'DB_USER', 'fh_wpadmin' );

/** Database password */
define( 'DB_PASSWORD', 'G7$kLm9!pQx2' );

/** Database hostname — use the MySQL IPv4 Address from your dashboard */
define( 'DB_HOST', '191.96.94.5' );
```

Replace the example values with your actual database name, username, password, and MySQL IPv4 address. That is all WordPress needs to connect.

<Info>
  Most web applications ask for these details during installation. WordPress, for example, prompts you to enter the database host, name, username, and password in its setup wizard — you do not usually need to edit config files by hand.
</Info>

### Example: General PHP Connection

For a custom PHP application, connecting to your database would look something like this:

```php theme={null}
$connection = new mysqli('191.96.94.5', 'fh_wpadmin', 'G7$kLm9!pQx2', 'fh_wordpress');

if ($connection->connect_error) {
    die('Connection failed: ' . $connection->connect_error);
}
echo 'Connected successfully!';
```

The key takeaway is the same for any application: you need four pieces of information — host, username, password, and database name.

***

## Using phpMyAdmin

phpMyAdmin is a web-based tool that lets you browse, search, edit, and manage your MySQL databases through a visual interface. Think of it as a spreadsheet viewer for your database — you can see all your tables, click through rows of data, run searches, and even edit individual records. No command-line knowledge required.

**What can you do with phpMyAdmin?**

* Browse your database tables and see what is stored inside them
* Run SQL queries if you need to fix something specific
* Import a database backup (`.sql` file) when migrating from another host
* Export your entire database as a backup file
* Search across all tables for a specific value (handy for debugging)
* Optimize or repair tables that have become slow or corrupted

<Steps>
  <Step title="Check for phpMyAdmin Access">
    Look for a **phpMyAdmin** link or button on the Databases page or in your control panel dashboard. If available, click it to launch the tool in a new browser tab.
  </Step>

  <Step title="Log In">
    Enter your **database username** and **password** when prompted. You will be connected directly to the databases that user has access to.
  </Step>

  <Step title="Browse and Manage Data">
    From here you can view tables, run SQL queries, import or export data, and perform administrative tasks like optimizing or repairing tables.
  </Step>
</Steps>

<Tip>
  phpMyAdmin is especially useful for importing large SQL files (such as database backups) or quickly searching through your data without needing to install any software on your computer.
</Tip>

***

## Common Use Cases

<AccordionGroup>
  <Accordion title="WordPress and CMS Installations">
    WordPress, Joomla, Drupal, and other content management systems all require a MySQL database. During installation, you will be asked to enter your database host, name, username, and password. Create a **dedicated database and user** for each CMS installation to keep your data organized and secure.
  </Accordion>

  <Accordion title="E-Commerce Applications">
    Online stores built with WooCommerce, PrestaShop, or OpenCart rely on a database to store products, orders, customer information, and inventory. Performance matters here — keep your database clean and consider regular optimization.
  </Accordion>

  <Accordion title="Custom Web Applications">
    If you are building a custom PHP, Python, or Node.js application, you can connect to your MySQL database using the connection details from your control panel. Use the MySQL IPv4 Address as the host, and reference your database name, username, and password in your application's configuration file.
  </Accordion>

  <Accordion title="Migrating a Database from Another Host">
    To move a database from another hosting provider, export it as an `.sql` file from your old host (using phpMyAdmin or a command-line tool), create a new database and user in the FREAKHOSTING panel, then import the `.sql` file through phpMyAdmin.
  </Accordion>
</AccordionGroup>

***

## Best Practices

<CardGroup cols={2}>
  <Card title="One Database Per Application" icon="box">
    Avoid sharing a single database between multiple websites or applications. Keeping them separate improves security and makes troubleshooting much easier.
  </Card>

  <Card title="Use Strong Passwords" icon="lock">
    Always use complex, unique passwords for each database user. Never reuse passwords from other accounts or services.
  </Card>

  <Card title="Back Up Regularly" icon="cloud-arrow-up">
    Export your databases on a regular schedule using phpMyAdmin or an automated backup plugin. This ensures you can recover your data if something goes wrong.
  </Card>

  <Card title="Limit User Privileges" icon="shield-check">
    Only grant the permissions each user actually needs. If an application only reads data, do not give its database user full write or admin privileges.
  </Card>
</CardGroup>

<Tip>
  If you are using WordPress, consider installing a backup plugin that automatically saves your database on a schedule. This way you always have a recent copy of your data without having to remember to export it manually.
</Tip>

***

## Troubleshooting

Having trouble connecting? Here are the most common issues and how to fix them:

<AccordionGroup>
  <Accordion title="Error: Access denied for user">
    This means your username or password is wrong. Double-check that you are using the **full prefixed username** (e.g., `fh_wpadmin`, not just `wpadmin`) and that the password matches exactly, including capitalization and special characters. If unsure, reset the password from the Databases page.
  </Accordion>

  <Accordion title="Error: Can't connect to MySQL server">
    You are probably using `localhost` instead of the actual MySQL IPv4 address. Go to your dashboard, find the **MySQL IPv4 Address** in the **At a Glance** panel, and use that IP address as your database host.
  </Accordion>

  <Accordion title="Error: Unknown database">
    The database name you entered does not match any database on your account. Check the Databases page for the exact name, including the prefix. Remember, `wordpress` and `fh_wordpress` are different names.
  </Accordion>

  <Accordion title="My app installed but the site shows a database connection error">
    This usually happens when database credentials were entered correctly during installation but have since changed, or when the database server is temporarily unreachable. Verify your credentials in your app's configuration file and confirm the MySQL IPv4 address has not changed.
  </Accordion>
</AccordionGroup>

***

<Note>
  ### Need Extra Help?

  If you encounter any issues, our support team is ready to assist:

  * **Live Chat:** Quick assistance via our website.
  * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
  * **Discord:** [Join our Community](https://discord.gg/freakhosting)
  * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)
</Note>

<Tip>
  ### Save on Your Hosting

  Ready to get a new server? Use code **KB20** at checkout for **20% off** your first month!
</Tip>

***

<div align="center">
  **Last Updated:** March 2026 | **Web Hosting Support:** MySQL database management simplified.
</div>
