Managing your MySQL databases

Everything to do with databases is in cPanel, in two places: MySQL Databases for creating and managing them, and phpMyAdmin for looking inside them.

MySQL Databases

Use this to create a database, create a user, and grant that user access. It also shows the size of each database and lets you rename or remove them. See Creating a database and a database user for the steps – the part people miss is granting the user access after creating both.

phpMyAdmin

This is where you look at and change the data itself. You can browse tables, run queries, export a backup and import one. It is genuinely useful and it has no undo, so export before you change anything – see Using phpMyAdmin without breaking anything.

Routine things worth knowing

  • Taking a backup – phpMyAdmin, choose the database, Export. Keep it off the hosting account.
  • Checking size – sort tables by size to find what is growing. On an older site this is usually sessions, logs or revisions.
  • Connecting from your own machine – possible but off by default, see Connecting to MySQL from your own computer.

What your application needs

Database name, username, password, and a host of localhost – not your domain name. Name and username both carry your account prefix.

If something goes wrong

Errors mentioning a specific table, or telling you to repair one, are covered in Repairing and optimising database tables. If you are unsure what a query will do, ask us before running it rather than afterwards.

  • 32 Users Found This Useful
Was this answer helpful?

Related Articles

How databases and database users are named

Database and user names are always prefixed with your cPanel account name and an underscore. You...

Creating a database and a database user

An application needs two things: a database to store data in, and a user with permission to use...

Using phpMyAdmin without breaking anything

phpMyAdmin, in cPanel, gives you direct access to your data. That is useful and it is also the...

Importing a large database

phpMyAdmin has an upload size limit, and a large database import will fail part-way through...

Connecting to MySQL from your own computer

By default, databases only accept connections from the server itself. That is deliberate: it...