# ERROR 1045 (28000) - Access denied for user 'root' @ 'localhost'

**URL:** <https://community.localwp.com/t/error-1045-28000-access-denied-for-user-root-localhost/46941>\
**Category:** Support\
**Tags:** windows-10\
**Created:** [February 3, 2025, 8:27pm UTC](https://community.localwp.com/t/error-1045-28000-access-denied-for-user-root-localhost/46941 "2025-02-03T20:27:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wplc](https://avatars.discourse-cdn.com/v4/letter/w/74df32/32.png) [@wplc](https://community.localwp.com/u/wplc)\
**Post date:** [February 3, 2025, 8:27pm UTC](https://community.localwp.com/t/error-1045-28000-access-denied-for-user-root-localhost/46941/1 "2025-02-03T20:27:53Z")

</div>

I’m new to web devlopment and am trying to host a local version of my existing WordPress site. The manual import option via a .zip file failed so I am attempting to import my site manually using these instructions: [Import/Export a WordPress Site - Local](https://localwp.com/help-docs/getting-started/how-to-import-a-wordpress-site-into-local/)

I’m at the step where I try to overwrite the database with my extracted SQL file. When I open the Local Site Shell and enter the “wp db import database.sql” command I receive the following error: “Error: Failed to get current SQL modes. Reason: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)”

I’m unsure of what I need to do to get around this. Where do I find the credentials? Where do they need to be entered? I utilize shared hosting through Hostek, in case that information changes things.

* * *

Local Version 9.2.0+6762

OS Information

| Edition | Windows 11 Pro |
| --- | --- |
| Version | 24H2 |
| Installed on | ‎1/‎13/‎2025 |
| OS build | 26100.2894 |
| Experience | Windows Feature Experience Pack 1000.26100.36.0 |

* * *

Log attached

[local-lightning.log](https://community.localwp.com/uploads/short-url/9tlcqABAXlDZzw6O2GnZls8eWlj.log) (103.8 KB)  
)

* * *

---

<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 4, 2025, 2:42pm UTC](https://community.localwp.com/t/error-1045-28000-access-denied-for-user-root-localhost/46941/2 "2025-02-04T14:42:13Z")

</div>

Hi @wplc

If you click on `Site Folder` in Local, and then navigate to App \> Public, within the Public folder you should have a `wp-config.php` file. You can open this in a text editor (I use Sublime) and see your DB configuration within.

 ![Screenshot 2025-02-04 at 8.41.41 AM](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/7/4/74ab62bb2c44c5bfe10f1b6780560f84787b3e93.png)

Do you know if your Local site and your live site have the same configuration set up as far as WP/PHP/DB and server type?

---

<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 5, 2025, 2:42pm UTC](https://community.localwp.com/t/error-1045-28000-access-denied-for-user-root-localhost/46941/3 "2025-05-05T14:42:34Z")

</div>

Closed on May 5, 2025, 2:42pm UTC

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