Database error (caused by WooCommerce?) when trying to test WordPress site locally

I have a WordPress website hosted on GoDaddy and want to test it locally.

I exported the database to SQL format and downloaded it on my local machine. Then I installed XAMPP and changed the config file ports from 80 to 8080. Now I can open my localhost on LOCALHOST:8080 instead of LOCALHOST.

After the port changes I created a new directory in XAMPP and inserted a HTML file to test on LOCALHOST:8080. It worked, so I was ready to transfer my WordPress files.

Firstly, I dragged and dropped all my WordPress files into the new folder I've created. Next I imported the database file into the MySQL. Finally I tried to access the WordPress site on my local using LOCALHOST:8080/wordpress/wp-admin, but when the site page comes up I get an error message, saying that my password or username is incorrect ad to open the wp-config file and update the info.

I opened the wp-config and changed the localhost option to localhost:8080. Also changed the database username and password. I can connect to the database now, but I'm getting an error:

Fatal error: Uncaught RuntimeException: Error saving action: Error saving action: Database error. in C:\xampp\apps\wordpress\htdocs\wp-content\plugins\woocommerce\packages\action-scheduler\classes\migration\ActionScheduler_DBStoreMigrator.php:44 Stack trace: #0 C:\xampp\apps\wordpress\htdocs\wp-content\plugins\woocommerce\packages\action-scheduler\classes\data-stores\ActionScheduler_HybridStore.php(242): ActionScheduler_DBStoreMigrator->save_action(Object(ActionScheduler_Action), NULL) #1 C:\xampp\apps\wordpress\htdocs\wp-content\plugins\woocommerce\packages\action-scheduler\classes\ActionScheduler_ActionFactory.php(177): ActionScheduler_HybridStore->save_action(Object(ActionScheduler_Action)) #2 C:\xampp\apps\wordpress\htdocs\wp-content\plugins\woocommerce\packages\action-scheduler\classes\ActionScheduler_ActionFactory.php(84): ActionScheduler_ActionFactory->store(Object(ActionScheduler_Action)) #3 C:\xampp\apps\wordpress\htdocs\wp-content\plugins\woocommerce\packages\action-scheduler\functions.php(36): ActionScheduler_ActionFactory->single('action_schedule...', Array, 1630078934, 'action-schedule...') #4 C:\xampp\apps\wordpress\htdocs\wp-content\plugins\woocommerce\packages\action-scheduler\classes\migration\Scheduler.php(89): as_schedule_single_action(1630078934, 'action_schedule...', Array, 'action-schedule...') #5 C:\xampp\apps\wordpress\htdocs\wp-content\plugins\woocommerce\packages\action-scheduler\classes\migration\Controller.php(99): Action_Scheduler\Migration\Scheduler->schedule_migration() #6 C:\xampp\apps\wordpress\htdocs\wp-includes\class-wp-hook.php(303): Action_Scheduler\Migration\Controller->schedule_migration('') #7 C:\xampp\apps\wordpress\htdocs\wp-includes\class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #8 C:\xampp\apps\wordpress\htdocs\wp-includes\plugin.php(470): WP_Hook->do_action(Array) #9 C:\xampp\apps\wordpress\htdocs\wp-settings.php(600): do_action('wp_loaded') #10 C:\xampp\apps\wordpress\htdocs\wp-config.php(111): require_once('C:\\xampp\\apps\\w...') #11 C:\xampp\apps\wordpress\htdocs\wp-load.php(50): require_once('C:\\xampp\\apps\\w...') #12 C:\xampp\apps\wordpress\htdocs\wp-blog-header.php(13): require_once('C:\\xampp\\apps\\w...') #13 C:\xampp\apps\wordpress\htdocs\index.php(17): require('C:\\xampp\\apps\\w...') #14 {main} thrown in C:\xampp\apps\wordpress\htdocs\wp-content\plugins\woocommerce\packages\action-scheduler\classes\migration\ActionScheduler_DBStoreMigrator.php on line 44


Note: I do not have enough reputation to comment, so someone else can comment and I can delete this answer.

It seems to me that the user used to access/connect the database server, now that it can connect, just needs to be granted privileges to read and write to the database and it's tables that you imported.

Read the GRANT General Overview section (or the whole page if you have the patience)

and grant the same user you added in the wp-config file enough permissions to read and write to the database/tables in the database.

Be specific where you can, i.e choose the user if possible, the host if possible, the database if possible, the tables if possible and the permission access (insert select, etc) if possible. Remember though much of these can take wildcards: (i.e. ALL, *, %)

GRANT ALL ON *.* TO 'someuser'@'%';

if you cant get specific enough, relax the GRANT using wildcards until you see somethings working, then tighten them up again.

Similar questions

Pagination when I use wp_query with 'post_type' => array('test','test')
When I use 2 or 3 different post_types I can't make the pagination. This only show me 2 posts, the pagination appears but when I make click on it still show me the same 2 posts.
Trying to edit a WP site locally using MAMP
I'm new to WordPress. A friend asked me to redesign his WP blog and I've installed it on my Mac using MAMP. I went through the database setup and imported the site's existing DB and added the tables. It all looks good, as far as I can tell, on the phpMyAdmin site. When I go to url "localhost" in Chrome (and other browsers) I see the blog's front pa...
Trying to run a WP Engine site locally but it keeps redirecting
I'm trying to run a wordpress site that is currently being hosted by Wordpress Engine locally. I followed the WP Engine instructions and did a find and replace on the sql file: But it's still being redirected to a url. When I do a search...
An update has caused my client's site to be non-existent after new update of Wordpress
I revised and backed up my client's site yesterday without any issues. As soon as I clicked the update Wordpress button the new install started then a few seconds later the following popped up on a new browser : Updated around 12am Sunday 21817. Site went into immediate http 500 error. I tried to log into the wordpress wp-admin page and the admin p...
How to solve slow WordPress site caused by attachment_metadata
My WordPress sites starting to become slower by time, after two years they become very slow. I tried many things, such as: Finally I checked core tables of WordPress (wp_posts and wp_postmeta) the main reason that my WordPress site is slow is because of the wp_postmeta, and unfortunately WooCommerce save its meta in the wp_postmeta which affects re...
Moving my wordpress site to main domain caused some errors
I am new to wordpress and hosting, so I just thought I could move my WordPress site (files) from the subdomain to the main domain and everything will work. It worked actually except for the URL in the main domain changed to show the URL for the subdomain. (Later I found out I could change the URL's in the settings. So I followed this tutorial ( htt...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.