How do I import my database into Local?

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

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:

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

Hi @Connor

Can you try this instead to see if that works?

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