"1044 - Access Denied" Error when Importing a MySQL Database

For IONOS web hosting

If you receive the error message "1044-Access denied" when importing a MySQL database into phpMyAdmin, please proceed as follows:

Please note: Before you make changes to the MySQL file, you should always make a backup copy!

  • Edit the MySQL file with a text editor.
  • Search the MySQL file for rows beginning with CREATEDATABASE or USE.
    Note: The CREATE DATABASE and USE commands cannot be processed by the MySQL server in shared hosting because customers do not have administrative access to them; therefore, the import terminates with error 1044.
  • Delete all statements that begin with CREATE DATABASE or USE. When deleting whole lines, please make sure that you do not inadvertently remove any further grazing.
  • Save your changes and repeat the import in phpMyAdmin.
Role model

In the following SQL dump, line 11 contains the CREATE DATABASE searched for and line 12 contains the USE command. The problem could be solved by deleting these two lines.

-- phpMyAdmin SQL Dump
-- version 2.6.4-pl3
-- http://www.phpmyadmin.net
-- Host: db123456789.hosting-data.io
-- Creation Time: 01. Januar 2013 um 12:00
-- Server Version: 5.3.3-7+squeeze14
-- Database `db123456789`
CREATE DATABASE `db123456789` DEFAULT CHARACTER SET latin1 COLLATE lating1_german2_ci;
USE db123456789;