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

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

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 (103.8 KB)
)


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.

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?