{"id":8589,"date":"2015-05-20T17:00:23","date_gmt":"2015-05-20T16:00:23","guid":{"rendered":"https:\/\/wp.okra.host\/article\/database-import-fails-create-database-line\/"},"modified":"2021-03-07T14:32:21","modified_gmt":"2021-03-07T13:32:21","slug":"database-import-fails-create-database-line","status":"publish","type":"ht_kb","link":"https:\/\/kb.okra.host\/de\/article\/database-import-fails-create-database-line\/","title":{"rendered":"Datenbank-Import schl\u00e4g fehl: CREATE DATABASE-Zeile"},"content":{"rendered":"<h2 id=\"overview\" >\u00dcbersicht<\/h2>\n<p>Restoring a database backup within the control panel, mysqli CLI, or phpMyAdmin may fail with the following message:<\/p>\n<p style=\"text-align: center\"><span style=\"color: #ff0000\">#1044 &#8211; Access denied for user &#8216;myuser&#8217;@&#8217;localhost&#8217; to database &#8216;mynewdb&#8217; <\/span><\/p>\n<h2 id=\"cause\" >Ursache<\/h2>\n<p>A <em>CREATE DATABASE<\/em>\u00a0query is issued during database import that cannot succeed due to limited permissions. All databases must be created within the <a href=\"https:\/\/kb.okra.host\/de\/mysql\/creating-a-database\/\">Bedienfeld<\/a> to ensure proper account namespacing is applied.<\/p>\n<h2 id=\"solution\" >L\u00f6sung<\/h2>\n<p>First create the\u00a0destination database within the control panel. \u00a0Next, remove the lines that begin with: <em>CREATE DATABASE<\/em> und <em>USE<\/em>. These lines normally occur consecutively.<\/p>\n<p><span style=\"color: #000080\">CREATE DATABASE IF NOT EXISTS `mynewdb` \/*!40100 DEFAULT CHARACTER SET utf8mb4 *\/; <\/span><br \/>\n<span style=\"color: #000080\">USE `mynewdb`<\/span><\/p>\n<p>becomes:<\/p>\n<p><span style=\"color: #000080\"><em>&lt;empty&gt;<\/em><\/span><\/p>\n<p>When importing a database in phpMyAdmin select the database in the left panel, then select\u00a0<em>Import<\/em> from the tabs in the right panel.<\/p>\n<p>When importing in mysql from the <a href=\"https:\/\/kb.okra.host\/de\/terminal\/accessing-terminal\/\">Terminal<\/a>, include the database name, e.g.<br \/>\n<code><\/code><\/p>\n<pre data-language=\"shell\"><code>mysql -u username -ppassword mynewdb &lt; dbbackup.sql<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>Overview Restoring a database backup within the control panel, mysqli CLI, or phpMyAdmin may fail with the following message: #1044 &#8211; Access denied for user &#8216;myuser&#8217;@&#8217;localhost&#8217; to database &#8216;mynewdb&#8217; Cause A CREATE DATABASE\u00a0query is issued during database import that cannot succeed due to limited permissions. All databases must be created&#8230;<\/p>","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[61],"ht-kb-tag":[],"class_list":["post-8589","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-mysql"],"_links":{"self":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/comments?post=8589"}],"version-history":[{"count":1,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8589\/revisions"}],"predecessor-version":[{"id":8590,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8589\/revisions\/8590"}],"wp:attachment":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/media?parent=8589"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-category?post=8589"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-tag?post=8589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}