I get this error when trying to change a database name on a new dev with no entries: phpmyadmin change db name error

What can be done?


Craft has a lot of foreign keys between tables, so something might be getting tripped up there. Here's what I'd suggest...

Instead of using phpMyAdmin to "Rename database to", perhaps try this:

  1. Export your existing DB to an SQL file.
  2. Create a new DB with the name you want.
  3. Import your SQL into the new DB.

Assuming that all goes smoothly, you can then go back and drop your original database.


MySQL doesn't have a native command for "Rename database" (well, they did at one point, but removed it shortly thereafter), so any MySQL client that offers that functionality ends up writing their own implementation for it.

That is usually somethings as simple as:

  1. Export data and schema to a backup.
  2. Create new database with new name.
  3. Import data and schema from backup.
  4. Delete old database.

But it looks like phpMyAdmin is trying to be more clever than that and failing. I would try Lindsey's suggestion as a workaround.


Looking at the error, it looks like you've got a dash (-) in your database table name prefix. That's considered a "special" character by MySQL and must be escaped in backticks `table-prefix.table-name`, which phpMyAdmin doesn't appear to be doing, so it's likely there is a phpMyAdmin bug there, too.

  • Brad - thanks for your explanations and suggestion Jul 9 '14 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.