MySQL databases

A MySQL database stores information for applications like WordPress, online stores, or forums. In this article you will see how to create a database with its user in cPanel, and how to import and export it with phpMyAdmin.

What is it for?

  • Create the database needed by a manually installed application.
  • Upload a database that you have on your computer to hosting, for example when migrating a site.
  • Download a copy of the database before making changes.

Access: log in to cPanel from the client portal → Log in to cPanel, or at https://yourdomain.com/cpanel. All options in this article are in the Databases section.

Sección Bases de datos de cPanel con Bases de datos MySQL y phpMyAdmin

Create a database

  1. Click on MySQL Databases.
  2. Under Create New Database, type a name and click Create Database.

Crear una nueva base de datos MySQL

  1. Return to the previous screen. The database appears under Current Databases with its full name: cPanel adds the account username as a prefix, for example username_store.

Listado de bases de datos actuales

Create the user and assign it

  1. Under Add New User, type a username and a secure password. You can use the Password Generator. Then click Create User. Just like the database, the user carries the account prefix.

Crear un usuario de base de datos con contraseña

  1. Under Add User to Database, choose the user and the database from the dropdowns and click Add.

Asociar un usuario a la base de datos

  1. Check ALL PRIVILEGES and click Make Changes.

Asignar privilegios al usuario de la base de datos

A notice confirms that the changes were applied.

Confirmación de privilegios guardados

Data to connect your application: server localhost, the full database name (with prefix), the full user name (with prefix) and its password.

Import a database

Before importing, you need an empty database created with the previous steps.

  1. In the Databases section, open phpMyAdmin.
  2. In the left panel, click on your database name and then on the Import tab.

Pestaña Importar de phpMyAdmin

  1. Click Choose File and select the file from your computer. .sql, .sql.gz and .sql.zip are accepted. Below the button is the maximum allowed size.
  2. Click Import at the bottom of the page. In older versions of phpMyAdmin, the button says Go.

Seleccionar el archivo SQL para importar

If everything went well, a green message appears and the tables are visible in the left panel.

Tablas importadas en la base de datos

Export a database

  1. In phpMyAdmin, click on your database name and then on the Export tab.

Pestaña Exportar de phpMyAdmin

  1. Leave the Quick method and the SQL format.
  2. Click Export (or Go, depending on the version). The browser downloads a .sql file.

Descargar la base de datos en formato SQL

Important: importing into a database that already has tables can cause errors or overwrite data. Export a copy before importing over a database in use. Databases also occupy disk space of the service.

Frequent issues

  • The application does not connect to the database: check that you use the full names with prefix, the localhost server, and that the user is assigned to the database with all privileges.
  • The file exceeds the maximum import size: compress it into .sql.gz or .sql.zip. If it is still large, open a ticket so that support can import it.
  • Error "#1044 Access denied" when importing: the file attempts to create a database with another name. Remove the CREATE DATABASE line and the USE line from the file, and import it inside the database you created.
  • Error "#1050 Table already exists": the database was not empty. Use a new database or delete the existing tables, after exporting a copy.
  • I cannot create more databases or I am running out of space: you reached the limit of the service. You can upgrade your service by consulting the sales department from the client portal or the online chat.

If you need help with your database, open a ticket from the client portal or consult through the site's online chat.

  • como crear base de datos myql, como subir una base de datos, crear base de datos mysql, permisos en base de datos
  • 71 Users Found This Useful
Was this answer helpful?

Related Articles

How to access a MySQL database remotely (home or work)

This article explains how to enable remote access to MySQL to connect from your computer, or...

Using Perl to access your MySQL database

This document contains information for connecting a Perl script with a hosting MySQL database...

Basic commands in MySQL

This article gathers basic MySQL commands to run in the SQL tab of phpMyAdmin. They are useful...

How to create a MySQL database

This article explains how to create a MySQL database in cPanel, how to import a .sql file, and...

How to manage MySQL databases

This article explains how to manage a MySQL database with phpMyAdmin from cPanel: searching data,...