<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>

CC BY-SA 3.0
2018-02-10T03:12:11.890Z
I created a database on my new server, and then went to import the sql file into it, and still got this error.
kingkelly
CC BY-SA 3.0
2018-02-10T09:32:24.613Z
The error says no db selected though.
carlcs
CC BY-SA 3.0
2018-02-09T16:54:23.803Z
2018-02-09T16:54:23.803Z
carlcs
<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>

CC BY-SA 4.0
2018-07-16T03:55:14.817Z
2018-07-16T03:55:14.817Z
Ryan
<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>

<database><mysql><import>
Importing a Craft database error
# 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.


---

