# How do I import my database into Local?

**URL:** <https://community.localwp.com/t/how-do-i-import-my-database-into-local/41548>\
**Category:** Support\
**Tags:** installation\
**Created:** [February 25, 2024, 9:56pm UTC](https://community.localwp.com/t/how-do-i-import-my-database-into-local/41548 "2024-02-25T21:56:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Connor](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@Connor](https://community.localwp.com/u/Connor)\
**Post date:** [February 25, 2024, 9:56pm UTC](https://community.localwp.com/t/how-do-i-import-my-database-into-local/41548/1 "2024-02-25T21:56:13Z")

</div>

## The Issue

* * *

I’ve used cPanel to download a copy of the contents of my server, I’ve read Local’s advice for installing a site from an export: [Import/Export a WordPress Site - Local](https://localwp.com/help-docs/getting-started/how-to-import-a-wordpress-site-into-local/#Manually-Import-a-Local-site)

It says to create a blank site, then find the wp-content folder of my downloaded site and use it to overwrite the folder that was there previously. I’ve done that, and my themes etc. are there and seem to work fine. Now I’m trying to install the database, using the following command:

`wp import db my_database_name.sql`

The database is in the correct place, in the public folder. But rather than importing it, I’m getting the following error:

`Error: Failed to get current SQL modes. Reason: ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)`

This means I cannot install my website’s content on the local environment.

## Potential Problem

* * *

Local seems to say my database is at port 10005:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/a/5/a5ae7b62b58cffeddb575aa3a458695b2fec8b76.png)

But for some reason it’s trying to connect to port 10061, could this be causing the issue? How do I fix this?

## System Details

* * *

- **Local Version:** 8.21

- **Operating System (OS) and OS version:** Windows 10

---

<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:** [February 27, 2024, 7:09pm UTC](https://community.localwp.com/t/how-do-i-import-my-database-into-local/41548/2 "2024-02-27T19:09:39Z")

</div>

Hi @Connor

Can you try this instead to see if that works?

> [@Unable to access database](https://community.localwp.com/t/unable-to-access-database/14465/13):
>
> Hey Everyone – We’ve been zeroing in on why this is happening and the general issue is that the wp db subcommands use the --no-defaults param which blocks out the custom MySQL config we provide. There is a solution but we ran into major issues when trying to implement it on Windows so we’re still working on a way to implement this in a way that works across the various environments. In terms of a workaround, as @kristarella mentioned, you should be able to do some of the basic things wit…

---

<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:** [May 27, 2024, 7:10pm UTC](https://community.localwp.com/t/how-do-i-import-my-database-into-local/41548/3 "2024-05-27T19:10:23Z")

</div>

Closed on May 27, 2024, 7:10pm UTC

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