Using phpMyAdmin without breaking anything

phpMyAdmin, in cPanel, gives you direct access to your data. That is useful and it is also the fastest way to destroy a site, because there is no undo.

Before you touch anything

Export the database first. Choose it in the left panel, click Export, and save the file. This takes ten seconds and is the only undo you will get.

Things it is genuinely good for

  • Taking a quick backup before a change
  • Correcting a single value – a site URL, an email address, a locked-out user
  • Checking table sizes to find what is bloating the database
  • Importing a database when moving a site

Rules worth following

  • Never run an UPDATE or DELETE without a WHERE clause. Without it you change every row in the table.
  • Run a SELECT first with the same WHERE, and look at what comes back. Those are exactly the rows you are about to change.
  • Do not edit serialised data by hand. If a value looks like a:3:{s:5:...}, leave it alone – the string lengths are recorded inside it and editing by hand corrupts it silently. See Moving a WordPress site to a new domain.
  • Do not drop tables because they look unused. Plenty of applications use tables that appear empty.

If you are unsure

Ask us before you run it, not after. Recovering from a bad UPDATE means restoring a backup, and the backup may be older than you would like.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Managing your MySQL databases

Everything to do with databases is in cPanel, in two places: MySQL Databases for creating and...

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...

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...