For Web Hosting packages

In the IONOS web hosting packages, the use of the MySQL commands CREATE DATABASE %DatabaseName% and USE %DatabaseName% are blocked for you for administrative reasons. Imports of SQL files that contain these commands fail with error 1044 - Access denied. To import a database nevertheless, for example to change the MySQL version, follow the steps below.

  • Make a backup copy of the SQL file you want to import.
  • Open the SQL file with a text editor, such as Notepad++.
  • Search for strings that are CREATE DATABASE %Database name% or USE %Database name%. %DatabaseName% is a placeholder for the actual database name in your SQL file.
  • Delete these commands. Be careful not to inadvertently remove other statements.
  • Save your changes.

How to import the cleaned SQL file into a database is described in the article Restoring a MySQL Database with phpMyAdmin.

Example

The following extract from an SQL file contains the CREATE DATABASE command in line 11 and the USE command in line 12. Since there are no other commands in either line, you can delete these lines completely.

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

Fixing Error #1046 - No Database Selected

If you encounter the message Error #1046 - No database selected in phpMyAdmin instead of Error #1044, simply click on the database name on the left side in phpMyAdmin. Your database is now selected, and the database name will then also be displayed in the upper-right corner by the server name. Now you can repeat the import process.