{"id":1596,"date":"2020-05-14T11:23:38","date_gmt":"2020-05-14T09:23:38","guid":{"rendered":"https:\/\/www.wp-moon.com\/?p=1596"},"modified":"2023-08-11T23:06:18","modified_gmt":"2023-08-11T21:06:18","slug":"woocommerce-unable-to-insert-download-log-entry-in-database","status":"publish","type":"post","link":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/","title":{"rendered":"WooCommerce : Unable to insert download log entry in database"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_custom_heading text=&#8221;Problem&#8221; use_theme_fonts=&#8221;yes&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]You have created with your own hands or with the help of one or more providers a<strong> site under WooCommerce<\/strong> allowing you to sell digital items, thus downloadable for your customers.<\/p>\n<p>The shop is in place, the files available for download are <strong>uploaded on the server<\/strong>, the product sheets are created, the customer area and the payment are set up and operational&#8230; in short everything is ready, but a problem occurs at a specific point in your purchasing process.<\/p>\n<p>A customer connects to his account to place an order for a downloadable product. He makes the payment. Everything went well, his payment is accepted, he finds the product he bought for download in his customer area, but when he clicks on it to retrieve it, the <em>following error message appears<\/em>:<\/p>\n<p><code>Unable to insert download log entry in database<\/code><\/p>\n<p>Note that in the base and in the administration the <strong>order is well registered.<\/strong> So the whole purchasing process went well. It is probably a problem directly <strong>related to the recovery of the purchased file<\/strong>.[\/vc_column_text][\/vc_column][\/vc_row][vc_row][vc_column][vc_custom_heading text=&#8221;The cause&#8221; use_theme_fonts=&#8221;yes&#8221;][vc_column_text]WooCommerce uses, like WordPress, the database to <strong>insert<\/strong> and access many <strong>useful data<\/strong>. The error is quite explicit, it is a problem in your database.[\/vc_column_text][\/vc_column][vc_column][vc_custom_heading text=&#8221;The solution&#8221; use_theme_fonts=&#8221;yes&#8221;][vc_column_text]We will look at the wc_download_log table. It is indeed this one in particular which is in question. Notably, because we need to see if it is the only problem in your database.<\/p>\n<p>First, connect to your database and find out if the <strong>wc_download_log<\/strong> <strong>table<\/strong> exists.<\/p>\n<p>If it doesn&#8217;t exist, you&#8217;ll have to create it. The easiest way to create it, is to go to your <a href=\"https:\/\/www.wp-moon.com\/troubleshoot-with-display-in-wordpress-administration\/\" title=\"Troubleshoot with display in WordPress administration\">WordPress administration<\/a>, <strong>disable then enable the WooCommerce<\/strong> plugin.<\/p>\n<p>To do this, look for the menu &#8220;Plugins&#8221; in the left part of your administration. You should be able to find the WooCommerce plugin. You just have to deactivate then reactivate the plugin.<\/p>\n<p>Otherwise, an alternative can be to create the table &#8220;<em>by hand<\/em>&#8220;. Here is an<em> example of SQL<\/em> script to create it :<\/p>\n<p>&nbsp;<\/p>\n<p><code>CREATE TABLE `wc_download_log` (<br \/>\n`download_log_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,<br \/>\n`timestamp` datetime NOT NULL,<br \/>\n`permission_id` bigint(20) unsigned NOT NULL,<br \/>\n`user_id` bigint(20) unsigned DEFAULT NULL,<br \/>\n`user_ip_address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '',<br \/>\nPRIMARY KEY (`download_log_id`),<br \/>\nKEY `permission_id` (`permission_id`),<br \/>\nKEY `timestamp` (`timestamp`),<br \/>\nCONSTRAINT `fk_wc_download_log_permission_id` FOREIGN KEY (`permission_id`) REFERENCES<br \/>\n`woocommerce_downloadable_product_permissions` (`permission_id`) ON DELETE CASCADE<br \/>\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci<\/code><\/p>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">You will need to get the right version of this script for your version of WooCommerce, as there may be <em>structural differences<\/em> from one version to another.<\/span><\/span><\/p>\n<p>If the table is not created, you will have to check the rights on your database. But if the other tables are present (otherwise you will encounter other errors), it should work.<\/p>\n<p>Of course, you will have to ask yourself how this problem could have occurred, and, if necessary, make an audit of your installation to see if everything is compliant, especially security level.[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>You have created a site under WooCommerce allowing you to sell digital items, thus downloadable for your customers. When the customer clicks on a download file, the following error message appears: Unable to insert download log entry in database.<\/p>\n","protected":false},"author":2,"featured_media":1569,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[102,103,104],"class_list":["post-1596","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fix-errors","tag-database","tag-sql-2","tag-woocommerce-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WooCommerce : Unable to insert download log entry in database - WP Moon<\/title>\n<meta name=\"description\" content=\"You have created a site under WooCommerce allowing you to sell digital items, thus downloadable for your customers. When the customer clicks on a download file, the following error message appears: Unable to insert download log entry in database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WooCommerce : Unable to insert download log entry in database - WP Moon\" \/>\n<meta property=\"og:description\" content=\"You have created a site under WooCommerce allowing you to sell digital items, thus downloadable for your customers. When the customer clicks on a download file, the following error message appears: Unable to insert download log entry in database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Moon\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpmoonwebsite\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-14T09:23:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-11T21:06:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/05\/woocommerce-unable-to-insert-download-log-entry-in-database.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1330\" \/>\n\t<meta property=\"og:image:height\" content=\"804\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alexandre G\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@alexgaboriau\" \/>\n<meta name=\"twitter:site\" content=\"@WPMoon4\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexandre G\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WooCommerce : Unable to insert download log entry in database - WP Moon","description":"You have created a site under WooCommerce allowing you to sell digital items, thus downloadable for your customers. When the customer clicks on a download file, the following error message appears: Unable to insert download log entry in database.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/","og_locale":"en_US","og_type":"article","og_title":"WooCommerce : Unable to insert download log entry in database - WP Moon","og_description":"You have created a site under WooCommerce allowing you to sell digital items, thus downloadable for your customers. When the customer clicks on a download file, the following error message appears: Unable to insert download log entry in database.","og_url":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/","og_site_name":"WP Moon","article_publisher":"https:\/\/www.facebook.com\/wpmoonwebsite","article_published_time":"2020-05-14T09:23:38+00:00","article_modified_time":"2023-08-11T21:06:18+00:00","og_image":[{"width":1330,"height":804,"url":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/05\/woocommerce-unable-to-insert-download-log-entry-in-database.png","type":"image\/png"}],"author":"Alexandre G","twitter_card":"summary_large_image","twitter_creator":"@alexgaboriau","twitter_site":"@WPMoon4","twitter_misc":{"Written by":"Alexandre G","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/#article","isPartOf":{"@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/"},"author":{"name":"Alexandre G","@id":"https:\/\/www.wp-moon.com\/en\/#\/schema\/person\/72a64e6910977ec9e4b32fd8da54369d"},"headline":"WooCommerce : Unable to insert download log entry in database","datePublished":"2020-05-14T09:23:38+00:00","dateModified":"2023-08-11T21:06:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/"},"wordCount":500,"commentCount":0,"publisher":{"@id":"https:\/\/www.wp-moon.com\/en\/#organization"},"image":{"@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/05\/woocommerce-unable-to-insert-download-log-entry-in-database.png","keywords":["database","sql","woocommerce"],"articleSection":["Fix Errors"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/","url":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/","name":"WooCommerce : Unable to insert download log entry in database - WP Moon","isPartOf":{"@id":"https:\/\/www.wp-moon.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/#primaryimage"},"image":{"@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/05\/woocommerce-unable-to-insert-download-log-entry-in-database.png","datePublished":"2020-05-14T09:23:38+00:00","dateModified":"2023-08-11T21:06:18+00:00","description":"You have created a site under WooCommerce allowing you to sell digital items, thus downloadable for your customers. When the customer clicks on a download file, the following error message appears: Unable to insert download log entry in database.","breadcrumb":{"@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/#primaryimage","url":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/05\/woocommerce-unable-to-insert-download-log-entry-in-database.png","contentUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/05\/woocommerce-unable-to-insert-download-log-entry-in-database.png","width":1330,"height":804},{"@type":"BreadcrumbList","@id":"https:\/\/www.wp-moon.com\/en\/woocommerce-unable-to-insert-download-log-entry-in-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.wp-moon.com\/en\/"},{"@type":"ListItem","position":2,"name":"Fix Errors","item":"https:\/\/www.wp-moon.com\/en\/category\/fix-errors\/"},{"@type":"ListItem","position":3,"name":"WooCommerce : Unable to insert download log entry in database"}]},{"@type":"WebSite","@id":"https:\/\/www.wp-moon.com\/en\/#website","url":"https:\/\/www.wp-moon.com\/en\/","name":"WP Moon","description":"","publisher":{"@id":"https:\/\/www.wp-moon.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wp-moon.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.wp-moon.com\/en\/#organization","name":"WP Moon","url":"https:\/\/www.wp-moon.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wp-moon.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/logo.png","contentUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/logo.png","width":290,"height":95,"caption":"WP Moon"},"image":{"@id":"https:\/\/www.wp-moon.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/wpmoonwebsite","https:\/\/x.com\/WPMoon4"]},{"@type":"Person","@id":"https:\/\/www.wp-moon.com\/en\/#\/schema\/person\/72a64e6910977ec9e4b32fd8da54369d","name":"Alexandre G","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2023\/09\/312419460_10229483707296045_2919774527885824513_n-100x100.jpg","url":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2023\/09\/312419460_10229483707296045_2919774527885824513_n-100x100.jpg","contentUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2023\/09\/312419460_10229483707296045_2919774527885824513_n-100x100.jpg","caption":"Alexandre G"},"description":"Alexandre, Web Developer &amp; Website Editor. I've been using WordPress for over 10 years in my professional environment and on personal projects. I created WP Moon to teach you how to use this CMS, solve your problems and show you all the tricks.","sameAs":["https:\/\/www.croque-pixel.com\/","https:\/\/x.com\/alexgaboriau","https:\/\/www.youtube.com\/@wp_moon\/videos"],"url":"https:\/\/www.wp-moon.com\/en\/author\/wp-moon\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/posts\/1596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/comments?post=1596"}],"version-history":[{"count":0,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/posts\/1596\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/media\/1569"}],"wp:attachment":[{"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/media?parent=1596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/categories?post=1596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/tags?post=1596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}