---
title: How to import/export a MariaDB/MySQL database on Cyberpanel
description: "CyberPanel makes it easy to import and export MySQL or MariaDB databases using **phpMyAdmin** or the **command line**. ### Prerequisites: - **CyberPanel installed** on your server. See **[this](https://truehost.com/support/knowledge-base/how-to-install-cyberpanel-ubuntu-and-almalinux/)** - **MariaDB/MySQL database** created in CyberPanel. You can refer to **[this guide](https://truehost.com/support/knowledge-base/how-to-create-a-database-on-cyberpanel/)**…"
url: "https://truehost.com/support/knowledge-base/how-to-import-export-a-mariadb-mysql-database-on-cyberpanel/"
updated: "2024-10-07"
category: Cloud
---

# How to import/export a MariaDB/MySQL database on Cyberpanel

CyberPanel makes it easy to import and export MySQL or MariaDB databases using **phpMyAdmin** or the **command line**.

### Prerequisites:

- **CyberPanel installed** on your server. See **[this](https://truehost.com/support/knowledge-base/how-to-install-cyberpanel-ubuntu-and-almalinux/)**
- **MariaDB/MySQL database** created in CyberPanel. You can refer to **[this guide](https://truehost.com/support/knowledge-base/how-to-create-a-database-on-cyberpanel/)** on how to create a database.
- You need to know the name of the Cyberpanel database that you will be importing to or exporting from
- **phpMyAdmin** access through CyberPanel or SSH access to the server. You will already be able to do this

## **Importing a MariaDB/MySQL Database**

Importing a database can be done through **phpMyAdmin** or the **command line**.

This guide assumes that the .sql file you want to import is on your locally computer,

##### **Method A: Import via phpMyAdmin**

1. **Log in to CyberPanel** using **[these steps](https://truehost.com/support/knowledge-base/how-to-access-cyberpanel/)**
2. **Access phpMyAdmin**:

- Go to **Databases > phpMyAdmin** from the left-hand sidebar.
- Click the database that is associated with the website, one to import the SQL file.

![](https://truehost.com/support/wp-content/uploads/2024/10/image-21.png)

3. **Import the SQL File**

First, you will need to adjust the upload_limit and memory_limit of your server to a reasonable value, like 800M, to avoid running into import errors due to that. See **[this guide](https://truehost.com/support/knowledge-base/how-to-adjust-php-ini-settings-on-cyberpanel-e-g-upload-limit-post_max_size-display_errors/)** on how to adjust

- Click the **Import** tab at the top of the phpMyAdmin page.
- Click **Choose File** and select the `.sql` file from your local machine that you want to import.
- Click **Import** to begin the import process. After the import is complete, you’ll see a success message.

![](https://truehost.com/support/wp-content/uploads/2024/10/image-22-1024x735.png)

##### **Method B: Import via Command Line (SSH)**

This section assumes that the .sql file you want to import is on uploaded somewhere on your server

- Access your server via SSH. Here is **[how to](https://truehost.com/support/knowledge-base/how-to-access-a-server-via-ssh-terminal/)**
- Run the MySQL command to import the database:

```
mysqld database_name < /path_to_import/database_backup.sql
```

Note that in the above command;

- **database_backup.sql**- This should be replaced with the actual name of your .sql file e.g *beadworkdb.sql*
- **/path_to_import/database_backup.sql** -This should be the actual path to the location of the file e.g /home/backup/**beadworkdb.sql**

![](https://truehost.com/support/wp-content/uploads/2024/10/image-23-1024x197.png)

- **Verify the Import:** After the import is complete, you can verify that the data has been imported by checking the database in **phpMyAdmin** or by running queries in the command line.

![](https://truehost.com/support/wp-content/uploads/2024/10/image-24-1024x773.png)

You may now use your database as desired. In case of a challenge, please check with our [support team](https://wa.me/19726743814)
