# Uh-oh! Unable to import site (database problem)

**URL:** <https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467>\
**Category:** Support\
**Created:** [October 10, 2023, 12:38pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467 "2023-10-10T12:38:19Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrvanes](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mrvanes](https://community.localwp.com/u/mrvanes)\
**Post date:** [October 10, 2023, 12:38pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/1 "2023-10-10T12:38:19Z")

</div>

### What issue or error are you experiencing?

Can not import database in Local copy of the Wordpress site.

* * *

### What steps can be taken to replicate the issue?

This is a fresh Local install (.deb on linux ubuntu 23.04), connected to my employers WP development wp-engine site, downloaded it and everything seems to run fine except the database import. I have multiple lightning-services processes running, amongst which is a mysql process that listens on localhost:10004.

```auto
# netstat -ltnp | grep mysq
tcp 0 0 127.0.0.1:10004 0.0.0.0:* LISTEN 549679/mysqld       
tcp6 0 0 ::1:10004 :::* LISTEN 549679/mysqld

```

But the import says it can’t connect as root@localhost using the default password:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/d/1/d19a40c843ed4d519308c01eb7ab67463e8275b4.png)  
This is the exact error in the Local logs:

```auto
10/10/2023, 1:56:48 PM [warn] [main] ImporterWPE: Unable to import site. -- {"stack":"Error: Command failed: %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysql --default-character-set=utf8 -A --skip-column-names -e SELECT @@SQL_MODE;\nERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)\n\n at ChildProcess.exithandler (node:child_process:430:12)\n at ChildProcess.emit (node:events:513:28)\n at maybeClose (node:internal/child_process:1091:16)\n at Socket.<anonymous> (node:internal/child_process:449:11)\n at Socket.emit (node:events:513:28)\n at Pipe.<anonymous> (node:net:322:12)"}

```

Connecting to the socket works like a charm? So why can’t Local connect and import the database?

```auto
# /home/martin/.config/Local/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysql --default-character-set=utf8 -A --skip-column-names -e "SELECT @@SQL_MODE;" -S /home/martin/.config/Local/run/k19pNJY-s/mysql/mysqld.sock
+-----------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+-----------------------------------------------------------------------------------------------------------------------+

```

* * *

### System Details

- **Local Version:** 8.0.0-20231009.2
- **Operating System (OS) and OS version:** Ubuntu 23.04

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [October 10, 2023, 2:31pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/2 "2023-10-10T14:31:47Z")

</div>

Hi @mrvanes

Are you able to manually import it using these steps?

> **[Import/Export a WordPress Site](https://localwp.com/help-docs/getting-started/how-to-import-a-wordpress-site-into-local/#Manually-Import-a-Local-site)**
>
> This help document will walk you through how to import and export a site to and from Local. It will also go over how to restore from only Local site files. Table of Contents: Local is pretty flexible…

---

<div class="post-metadata">

**Author:** ![mrvanes](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mrvanes](https://community.localwp.com/u/mrvanes)\
**Post date:** [October 10, 2023, 3:35pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/3 "2023-10-10T15:35:57Z")

</div>

I would, if I knew where it stored and kept autoload.sql?

```auto
10/10/2023, 5:29:39 PM [info] [main] WPEPullService: Downloaded autoload.sql from devinacadem. File size of 11360178 bytes

```

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [October 10, 2023, 3:39pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/4 "2023-10-10T15:39:28Z")

</div>

Are you able to download a backup of your WPE site? That will give you a zip file including the Database. You could also use a free plugin like WP Migrate Lite to grab a site backup as well.

- Create and Download a Backup from WPE: [Backup and Restore - Support Center](https://wpengine.com/support/restore/#Download_a_Backup)

---

<div class="post-metadata">

**Author:** ![mrvanes](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mrvanes](https://community.localwp.com/u/mrvanes)\
**Post date:** [October 10, 2023, 3:42pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/5 "2023-10-10T15:42:44Z")

</div>

I can access the admin pages of the site, but “export” would result in a .wxr (xml base) file, it says? 'm not sure whether I can install plugins though?

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [October 10, 2023, 3:50pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/6 "2023-10-10T15:50:11Z")

</div>

On your WP Engine dashboard you would be creating and downloading a backup of the hosted site with the instructions on the link above, not trying to export from within the WordPress dashboard.

---

<div class="post-metadata">

**Author:** ![mrvanes](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mrvanes](https://community.localwp.com/u/mrvanes)\
**Post date:** [October 10, 2023, 3:54pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/7 "2023-10-10T15:54:00Z")

</div>

Yes, managed to do that now.  
I have the DB backup, but I assume I need to load it into a database called ‘local’? This doesn’t exist (probably due to the failure) so should I create an empty DB local?

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [October 10, 2023, 3:57pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/8 "2023-10-10T15:57:11Z")

</div>

Hi @mrvanes

It shouldn’t matter too much but you could use a command like `wp db reset --yes` before importing the new DB just to make sure it’s a clean install. After that you could jump to the last few steps here.

> **[Import/Export a WordPress Site](https://localwp.com/help-docs/getting-started/how-to-import-a-wordpress-site-into-local/#Manually-Import-a-Local-site)**
>
> This help document will walk you through how to import and export a site to and from Local. It will also go over how to restore from only Local site files. Table of Contents: Local is pretty flexible…

---

<div class="post-metadata">

**Author:** ![mrvanes](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mrvanes](https://community.localwp.com/u/mrvanes)\
**Post date:** [October 10, 2023, 4:02pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/9 "2023-10-10T16:02:31Z")

</div>

There is no command ‘wp’ and Open site shell doesn’t work (for me, I’m on KDE. Maybe you hard-coded the required shell application?)

I can load the DB into the Local server, I just need to know the required name?

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [October 10, 2023, 8:00pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/10 "2023-10-10T20:00:42Z")

</div>

Sorry looking back I see that you mentioned the database doesn’t exist at all or failed?

> I assume I need to load it into a database called ‘local’? This doesn’t exist (probably due to the failure) so should I create an empty DB local?

What might be easier is just spinning up a new, blank site in Local which is what I was inferring when I mentioned the steps to manually import a site. That way you’ll spin up a base install and then manually replace its files and DB with your WP-Content and SQL database.

> There is no command ‘wp’ and Open site shell doesn’t work (for me, I’m on KDE. Maybe you hard-coded the required shell application?)

When you click on Open Site Shell what happens? Do you get an error or does it just not open at all?

If you go to Preferences\>Advanced\>Appearance & Behavior you can see what your default Terminal application is set to.

---

<div class="post-metadata">

**Author:** ![mrvanes](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mrvanes](https://community.localwp.com/u/mrvanes)\
**Post date:** [October 11, 2023, 3:10pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/11 "2023-10-11T15:10:48Z")

</div>

Ok, this is embarassing. I redid the whole pull, and this time everything seems ok, even the database pull and restore (btw Open Site shell still doesn’t work, nothing happens when I click the option and I can’t find any reference to terminal in preferences).

Thank you very much for your timely responses and patient support!  
Let’s see now whether I can tame this beast from here 😉

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [October 11, 2023, 3:19pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/12 "2023-10-11T15:19:34Z")

</div>

Glad to hear you made some progress @mrvanes! Happy Developing 💚

---

<div class="post-metadata">

**Author:** ![mrvanes](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mrvanes](https://community.localwp.com/u/mrvanes)\
**Post date:** [October 12, 2023, 1:10pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/13 "2023-10-12T13:10:07Z")

</div>

And now all my problems are solved. Please keep track of this somewhere in your knowledge base (I mentioned KDE/Plasma!) and please consider using the platform indepent /usr/bin/x-terminal-emulator

[https://neilpie.co.uk/2023/06/16/local-wp-open-site-shell-not-working-on-kde-plasma/](https://neilpie.co.uk/2023/06/16/local-wp-open-site-shell-not-working-on-kde-plasma/)

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [October 12, 2023, 1:58pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/14 "2023-10-12T13:58:25Z")

</div>

Thank you for sharing that so other users will be able to search for and find here now. I’ll check with the Dev team on this as well.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [October 14, 2023, 2:43am UTC](https://community.localwp.com/t/uh-oh-unable-to-import-site-database-problem/39467/16 "2023-10-14T02:43:17Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
