Create a MySQL database
Create a MySQL database and its user, then open it in phpMyAdmin to view or import your data.
·3 min read
To create a database at Upkyo, open your hosting, then Databases, click Create a database, enter a name (letters, numbers and underscores) and choose MySQL. Keep Create a user with the same name checked, choose a password, then open the database with the phpMyAdmin icon to view or import data.
A database stores the dynamic content of a website: posts, pages, customer accounts, orders and settings. WordPress, PrestaShop, Joomla and most PHP applications need one to work. This guide explains how to create a MySQL database on your Upkyo hosting, how to access it with phpMyAdmin and how to import an existing database, for example when moving a site.
Before you start
- Check that your plan still allows another database: the number of databases depends on your plan.
- Prepare a strong password and store it in a password manager.
- If you install WordPress from the client area, you can skip this guide: the database is created automatically.
Create a database step by step
- Open your hosting, then Databases.
- Click Create a database.
- Enter its name: letters, numbers and underscores only.
- Choose MySQL.
- Keep Create a user with the same name checked.
- Choose a password for this user, then confirm.
- To view or import data, click the phpMyAdmin icon next to the database.
WordPress creates its own database: there is nothing to do for a site installed from the client area.
Database, user and password: what are they for?
An application needs four pieces of information to talk to its database:
- the database name, the one you just chose;
- the username, identical to the database name if you kept the option checked;
- the password of that user;
- the host of the database server.
You enter these details in your application's configuration file. For WordPress, it is the wp-config.php file at the root of httpdocs. A single mistake in these values causes the "Error establishing a database connection" message, see Error establishing a database connection in WordPress.
Import an existing database in phpMyAdmin
During a migration, you usually get a .sql (or .sql.gz) file exported from your previous host.
- Create an empty database by following the steps above.
- Click the phpMyAdmin icon next to that database.
- Check that the database is selected in the left column.
- Open the Import tab.
- Choose your
.sqlfile, then click Import at the bottom of the page.
If the file is very large and the import stops, compress it as .gz or open a ticket: support can help. Upkyo also offers free migration of your site from your current host.
Export a database to back it up
In phpMyAdmin, select the database, open the Export tab, keep the quick method and the SQL format, then click Export. You get a file you can keep on your computer. Your hosting backups also include your databases, see Restore a backup of your website.
Common errors
- Name rejected: it contains a space, a hyphen or an accented letter. Use only letters, numbers and the underscore
_. - Access denied in the application: the password or username in the configuration file does not match.
- Import takes too long or fails: the file exceeds upload limits. Compress it or ask support for help.
Frequently asked questions
How do I create a MySQL database?
Open your hosting, then Databases, click Create a database, give it a name and choose MySQL. Keep the same-name user option and choose a password.
How do I open phpMyAdmin?
In the Databases tool, click the phpMyAdmin icon next to the database. phpMyAdmin opens directly on that database.
Do I need to create a database to install WordPress?
No, not if you install it from the client area: the database is created automatically, see Install WordPress on your hosting. A manual database is only useful for a manual install or a migration.
How do I import a .sql file?
Create an empty database, open it in phpMyAdmin, then use the Import tab to upload your file. Check first that the right database is selected.
What is the difference between a database and a database user?
The database holds the data. The user is the account allowed to read and change it, with its own password.