Knowledge Essentials - 3Essentials Hosting

MySQL Restore From phpMyAdmin fails with 'Can't create database 'database_name1'; database exists'

Article ID: 330

 Back to Search

ISSUE:
When you attempt to restore a MySQL database from a previous backup using phpMyAdmin, the restore fails with the following error:

Can't create database 'database_name1'; database exists

CAUSE:
This is because the database already exists, because it was created in PLESK.  PLESK doesn't alter the phpMyAdmin SQL Dump script to remove the CREATE DATABASE `database_name1`; clause.  Therefore , when you execute the .sql file in phpMyAdmin to perform a restore the database already exists and phpMyAdmin halts execution.

RESOLUTION:
Simply edit the .sql file and remove the line that has:
CREATE DATABASE `database_name1`;  where database_name1 is the name of your MySQL Database.

Then execute the .sql file in phpMyAdmin for the restore function.

 

 
Downloads Associated With This Article
No downloads are currently associated with this article.