-
-
Save conschneider/c7b5ca8cf76a94b2df88f2c30756046b to your computer and use it in GitHub Desktop.
/* | |
* Please note the wp_ prefix and change accordingly if needed! | |
* Also check the table names so you don't drop data of tables already there! | |
*/ | |
SET NAMES utf8mb4; | |
SET FOREIGN_KEY_CHECKS = 0; | |
-- ---------------------------- | |
-- Table structure for wp_wc_reserved_stock | |
-- ---------------------------- | |
DROP TABLE IF EXISTS `wp_wc_reserved_stock`; | |
CREATE TABLE `wp_wc_reserved_stock` ( | |
`order_id` bigint(20) NOT NULL, | |
`product_id` bigint(20) NOT NULL, | |
`stock_quantity` double NOT NULL DEFAULT '0', | |
`timestamp` datetime NOT NULL DEFAULT '0000-01-01 00:00:00', | |
`expires` datetime NOT NULL DEFAULT '0000-01-01 00:00:00', | |
PRIMARY KEY (`order_id`,`product_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; | |
-- ---------------------------- | |
-- Records of wp_wc_reserved_stock | |
-- ---------------------------- | |
BEGIN; | |
COMMIT; | |
SET FOREIGN_KEY_CHECKS = 1; |
I just change this line and it work.
Great, glad it worked. Thanks for leaving your input here!
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Thanks both, I also changed collate to utf8mb4_unicode_ci to be consistent with my DB and it worked a treat :)
Thanks both, I also changed collate to utf8mb4_unicode_ci to be consistent with my DB and it worked a treat :)
👍 :).
It worked !
Thanks !
Where can I do this? In which file should I change the line?
Where can I do this?
This is a SQL query, which you need to run in a database client (i.e. phpMyAdmin)
In which file should I change the line?
I am referring to the table name in line 13.
wp_wc_reserved_stock
>> wp_
is the prefix and can differ in installations.
I can't do anything! The error remained. I'm doing something wrong. Please write more details.
I have got the table generated - however still seeing the message :
WooCommerce wp_wc_reserved_stock table creation failed. Does the wp user have CREATE privileges on the wordpress_somedb database?
I have got the table generated - however still seeing the message :
WooCommerce wp_wc_reserved_stock table creation failed. Does the wp user have CREATE privileges on the wordpress_somedb database?
To my knowledge this happens because these values do not match your environment ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
I just change this line and it work.
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Thank you for the support!!