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

# Managing MySQL Databases

> Create, manage, and clone MySQL databases in Cito

## Using the Dashboard

You can manage MySQL databases from Site Settings, or alternatively from the Databases page in the dashboard.

You can use the search bar to filter for specific databases. You can also use the 'All servers' checkbox to search for databases on other servers, if you have more than one.

From Sites, you can navigate to Settings and then the 'Databases' section, to see a list of databases owned by that site.

<img src="https://mintcdn.com/prostackhosting/mdYxEEoAStQaBUbz/images/screenshots/databaselist.png?fit=max&auto=format&n=mdYxEEoAStQaBUbz&q=85&s=832dbf99fcf250a6285b61536da9af62" alt="DB list" width="2520" height="576" data-path="images/screenshots/databaselist.png" />

To add a new database, simply click the "Create Database" link in the **top right corner** of the dashboard.

<img src="https://mintcdn.com/prostackhosting/mdYxEEoAStQaBUbz/images/screenshots/createdb.png?fit=max&auto=format&n=mdYxEEoAStQaBUbz&q=85&s=a82e7fd2f2a2c304595fb02042072c24" alt="Create database" width="954" height="1330" data-path="images/screenshots/createdb.png" />

You will be prompted for a database **name**, **username** and **password**. The username and password will be automatically generated if left blank.

You may also need to select an owner for the database- this is a site that is associated with the database.

Once created, you will see the new database details displayed to you.

<Warning>
  **MySQL passwords are not shown**

  We do not display MySQL passwords by default- you can click the icon next to the password field to copy it to your clipboard. If you lose access to a MySQL password you'll need to reset it.
</Warning>

### Cloning databases

It can be useful to clone a MySQL database, for example if you need a copy of it for testing purposes. Cloning a database generates a new MySQL user. Existing grants and privileges are *not* copied.

To clone a MySQL database, click the Clone icon in the actions menu on the databases page.

<img src="https://mintcdn.com/prostackhosting/mdYxEEoAStQaBUbz/images/screenshots/clonedbicon.png?fit=max&auto=format&n=mdYxEEoAStQaBUbz&q=85&s=0e414c0d3bf1ed85088eac4de9208004" alt="Database" width="112" height="118" data-path="images/screenshots/clonedbicon.png" />

You'll need to specify a new username and password for the MySQL user, as well as a new name for the database.

Once done, click Clone to start the process. Large databases may take a few moments to complete.

<img src="https://mintcdn.com/prostackhosting/mdYxEEoAStQaBUbz/images/screenshots/clonedb.png?fit=max&auto=format&n=mdYxEEoAStQaBUbz&q=85&s=9b13c3e32a68dc3a4ec5de52aba847ec" alt="Database" width="974" height="1160" data-path="images/screenshots/clonedb.png" />

### Managing MySQL Users

You can manage MySQL users by clicking the User icon next to the database. This will allow you to add additional MySQL users, set permissions, or reset a user's MySQL password.

This also allows you to set specific privileges for MySQL users- for example, you can create a read-only user with only the `SELECT` privilege on your database.

<img src="https://mintcdn.com/prostackhosting/mdYxEEoAStQaBUbz/images/screenshots/dbprivs.png?fit=max&auto=format&n=mdYxEEoAStQaBUbz&q=85&s=eb3848c2db53b9f728fb086c03bc2189" alt="Database" width="972" height="1082" data-path="images/screenshots/dbprivs.png" />

## Using PHPMyAdmin

Some customers may wish to use the 'PHPMyAdmin' utility to manage their databases graphically. PHPMyAdmin is accessible from the "Tools" section of the left navigation menu.

### Accessing the MySQL command line

You can also perform common MySQL operations at the MySQL command line. You must be logged in as `admin` to do this.

### Importing data from a SQL dump

You may wish to import MySQL data into a newly-created database, using a `.sql` file created using `mysqldump` or similar.

To do this, issue the following as the `admin` user.

```bash theme={null}
mysql <dbname> < export.sql
```

Substitute `<dbname>` for the database name and `export.sql` for the filename of your MySQL data.

## Remote MySQL database access

For security purposes, remote access to MySQL is disallowed by default. Please [contact support](/support/contact) if you need to remotely connect to MySQL using a tool such as MySQL workbench or HeidiSQL.

## Orphaned databases

In Cito all databases are owned (i.e. associated with) a site. This makes it easy to track what databases belong to a site.

We attempt to automatically detect databases and link them to a site, but in some cases this is not possible.

If you see a message about an Orphaned database, you can find that database and use the dropdown menu to assign it to a site. This only needs to be done once.

More information can be found at [Database ownership](/managing-sites/database-ownership).
