# Error connecting/selecting the database

**URL:** <https://community.localwp.com/t/error-connecting-selecting-the-database/34720>\
**Category:** Support\
**Created:** [December 13, 2022, 11:17am UTC](https://community.localwp.com/t/error-connecting-selecting-the-database/34720 "2022-12-13T11:17:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valooo](https://avatars.discourse-cdn.com/v4/letter/v/d07c76/32.png) [@Valooo](https://community.localwp.com/u/Valooo)\
**Post date:** [December 13, 2022, 11:17am UTC](https://community.localwp.com/t/error-connecting-selecting-the-database/34720/1 "2022-12-13T11:17:37Z")

</div>

### Issue Summary

I simply wanted to import an existing live website into Local. It’s been a week, I’ve tried everything, from the “just drag and drop the zip file” to the All-in-one WP Migration plugin. Nothing worked.

My current attempt: I have created a Local website to host the copy of the existing website, the website files are copied locally in /app/public/, I have exported the SQL and imported it into the local Adminer, I made sure the credentials were the same in the wp-config.php file as written in the Database tab in Local, but still have a screen saying:

“Error when connecting to the database”, “Impossible to select the database - The database server is not connected (which means your ID and password are correct), but the database globalpotential cannot be selected”

What shall I do?

#### Troubleshooting Questions

- Does this happen for all sites in Local, or just one in particular?  
Shall I really try importing another live existing website to see if there’s a difference?

- Are you able to create a new, plain WordPress site in Local and access it in a Browser?  
Yes, I am.

#### Replication

1. Create a plain Local website
2. Choose an existing live website
3. Copy all the files from the existing live website to the local folder
4. Export the SQL dump of the existing live website
5. Import the SQL dump in the Local website Adminer
6. Edit the wp-config.php file according to the info displayed in the Database tab in Local
7. Hope it works

#### System Details

- Which version of Local is being used? 6.5.2+6204

- What Operating System (OS) and OS version is being used?  
Windows 10 Family

 ![Capture15](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/c/e/ce3ce64c07c01ad385883c4703c981c93a0d305c.png)

---

<div class="post-metadata">

**Author:** ![sambrockway](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/sambrockway/32/18726_2.png) [@sambrockway](https://community.localwp.com/u/sambrockway)\
**Post date:** [December 14, 2022, 4:24pm UTC](https://community.localwp.com/t/error-connecting-selecting-the-database/34720/2 "2022-12-14T16:24:24Z")

</div>

Hi there @Valooo -

Have you happened to try the BackWPup plugin as recommended in this help doc?

> **[How to Import a WordPress Site into Local](https://localwp.com/help-docs/getting-started/how-to-import-a-wordpress-site-into-local/)**
>
> Local is pretty flexible about being able to import a WordPress site from a archive. There are two required things that Local needs for the import to be successful: There are a few ways to get a zip…

Let me know,

Sam

---

<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:** [March 14, 2023, 4:25pm UTC](https://community.localwp.com/t/error-connecting-selecting-the-database/34720/3 "2023-03-14T16:25:11Z")

</div>

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