Answers.Body: <p>MySQL exports only include the tables, not the database settings. You need to create a database first, open it and then import the tables.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-10T03:12:11.890Z
Answers.Text: I created a database on my new server, and then went to import the sql file into it, and still got this error.
Answers.UserDisplayName: kingkelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-10T09:32:24.613Z
Answers.Text: The error says no db selected though.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-09T16:54:23.803Z
Answers.LastActivityDate: 2018-02-09T16:54:23.803Z
Answers.UserDisplayName: carlcs
Answers.Body: <p>This caught me out too. </p>
  
  <p>In PhpMyAdmin, click Databases tab, click the database you wish to import into, then Import tab.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-16T03:55:14.817Z
Answers.LastActivityDate: 2018-07-16T03:55:14.817Z
Answers.UserDisplayName: Ryan
Body: <p>I dumped from Craft my database from server A and am trying to install it to a fresh copy of Craft on server B.</p>
  
  <p>I've got Craft up and running, and when I try importing my Craft SQL file in PHPmyAdmin, I get an error every time:</p>
  
  <p><img src="https://i.sstatic.net/h5ufN.png" alt="craft error"></p>
  
  <p>Is there something I need to setup in Craft regarding asset files before my import will work?</p>
  
Tags: <database><mysql><import>
Title: Importing a Craft database error
ThreadText: # Importing a Craft database error
  
  (Asked by: username_0 on 2018-02-09)
  
  I dumped from Craft my database from server A and am trying to install it to a fresh copy of Craft on server B.
  
  I've got Craft up and running, and when I try importing my Craft SQL file in PHPmyAdmin, I get an error every time:
  
  ![craft error](https://i.sstatic.net/h5ufN.png)
  
  Is there something I need to setup in Craft regarding asset files before my import will work?
  
  **Tags:** database, mysql, import
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-02-09. Score: 2
  
  MySQL exports only include the tables, not the database settings. You need to create a database first, open it and then import the tables.
  
  > **Comments:**
  > **username_0**: I created a database on my new server, and then went to import the sql file into it, and still got this error.  
  > **username_1**: The error says no db selected though.  
  
  ---
  
  ### Answer by username_2 on 2018-07-16. Score: 1
  
  This caught me out too.
  
  In PhpMyAdmin, click Databases tab, click the database you wish to import into, then Import tab.
  
  
  ---
  
  