{"id":3665,"date":"2024-10-08T07:30:00","date_gmt":"2024-10-08T07:30:00","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/error-1193-hy000-unknown-system-variable-gtid-purged\/"},"modified":"2025-12-01T14:45:23","modified_gmt":"2025-12-01T09:15:23","slug":"error-1193-hy000-unknown-system-variable-gtid-purged","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/error-1193-hy000-unknown-system-variable-gtid-purged\/","title":{"rendered":"ERROR 1193 (HY000): Unknown system variable &#8216;GTID_PURGED&#8217; &#8211; How to Solve?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In the MySQL database, you may encounter the following error during migrations or imports:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ERROR 1193 (HY000): Unknown system variable 'GTID_PURGED'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This error is related to Global Transaction Identifiers (GTIDs) in your SQL file, which is not being identified by the MySQL version. In this post, I&#8217;ll show you how you can fix this error.<\/p>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-primary\" role=\"alert\">u003cstrongu003eQuick Solution:u003c\/strongu003e Open your SQL file and remove all the lines that contain the @@GLOBAL.GTID_PURGED reference.<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">\u00d7<\/span><\/button><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">What Causes the &#8220;Unknown system variable &#8216;GTID_PURGED'&#8221; Error?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In MySQL servers, the GTID_PURGED variable tracks transactions that have been purged from the binary logs. Each transaction is assigned a GTID, which is used to maintain consistency during replication.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Unknown system variable &#8216;GTID_PURGED&#8217; commonly occurs in the following scenarios:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You are migrating a database that was exported from a server with GTIDs enabled<\/li>\n\n\n\n<li>The SQL dump file contains statements related to GTID_PURGED<\/li>\n\n\n\n<li>You are using an older version of MySQL that does not support GTIDs<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Solution to MySQL GTID Error: Unknown System Variable &#8216;GTID_PURGED&#8217;<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Solution 1: The Command Line Method (Fastest)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Best for large database files.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can solve this error simply by removing the GTID (@@GLOBAL.GTID_PURGED) references from the SQL file that you&#8217;re importing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the terminal and navigate to the directory containing the SQL file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/path\/to\/your\/sql\/file<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, use the sed command to remove the GTID references from the SQL file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sed -i '\/@@GLOBAL.GTID_PURGED=\/d' your_sql_file.sql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can replace your_sql_file.sql with your actual SQL file name in the above command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Solution 2: The Manual Method (Easiest)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Best for smaller database files.&nbsp;<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open your SQL file and search for the following line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SET @@GLOBAL.GTID_PURGED = \u2018xxxxxx\u2019;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">or<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SET GLOBAL GTID_PURGED=\u2019\u2026\u2019;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then, remove this line completely, save the file and import the database again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the SQL file is modified, you can then import the file into the MySQL database without any error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I hope this tutorial has helped you fix the ERROR 1193 (HY000): Unknown system variable &#8216;GTID_PURGED&#8217; issue in MySQL. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need technical support,<a href=\"https:\/\/meetanshi.com\/contacts\"> contact us<\/a> today! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the MySQL database, you may encounter the following error during migrations or imports: This error is related to Global Transaction Identifiers (GTIDs) in your&#8230;<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-3665","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/3665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=3665"}],"version-history":[{"count":2,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/3665\/revisions"}],"predecessor-version":[{"id":24520,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/3665\/revisions\/24520"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=3665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=3665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=3665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}