{"id":495,"date":"2012-12-14T12:53:15","date_gmt":"2012-12-14T12:53:15","guid":{"rendered":"http:\/\/www.mysqltutorial.org\/?page_id=495"},"modified":"2023-12-31T02:22:53","modified_gmt":"2023-12-31T09:22:53","slug":"mysql-reset-auto-increment-value","status":"publish","type":"page","link":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/","title":{"rendered":"MySQL Reset Auto Increment Values"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, we\u00a0 will show you various ways to reset the auto-increment values of <code>AUTO_INCREMENT<\/code> columns in MySQL.<\/p>\n\n\n\n<p>MySQL provides you with a useful feature called <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-auto_increment\/\">auto-increment<\/a>. You can assign the <code>AUTO_INCREMENT<\/code> attribute to a column of a table to generate a unique identity for the new row. Typically, you use the <code>AUTO_INCREMENT<\/code> attribute for the <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-primary-key\/\">primary key<\/a> column of the table.<\/p>\n\n\n\n<p>Whenever you <a title=\"MySQL INSERT\" href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-insert\/\">insert a new row into a table<\/a>, MySQL automatically\u00a0assigns a sequence number to the <code>AUTO_INCREMENT<\/code> column.<\/p>\n\n\n\n<p>For example, if the table has eight rows and you insert a new row without specifying the value for the auto-increment column, MySQL will automatically insert a new row with <code>id<\/code> value 9.<\/p>\n\n\n\n<p>Sometimes, you may need to reset the value of the auto-increment column so that the first record&#8217;s identity that you insert into the table starts from a specific number.<\/p>\n\n\n\n<p>In MySQL, you can reset auto-increment values in various ways.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MySQL reset auto-increment value examples<\/h2>\n\n\n\n<p>First, <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-create-table\/\">create a table<\/a> named <code>items<\/code> and\u00a0assign the\u00a0<code>AUTO_INCREMENT<\/code> attribute to the\u00a0<code>id<\/code> \u00a0primary key column.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> items (\n  <span class=\"hljs-keyword\">id<\/span> <span class=\"hljs-built_in\">INT<\/span> AUTO_INCREMENT,\n  <span class=\"hljs-keyword\">name<\/span> <span class=\"hljs-built_in\">VARCHAR<\/span>(<span class=\"hljs-number\">45<\/span>) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>,\n  PRIMARY <span class=\"hljs-keyword\">KEY<\/span> (<span class=\"hljs-keyword\">id<\/span>)\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-insert\/\">insert<\/a> some sample data into the <code>items<\/code> \u00a0table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span> items(<span class=\"hljs-keyword\">name<\/span>)\n<span class=\"hljs-keyword\">VALUES<\/span>(<span class=\"hljs-string\">'Item 1'<\/span>),\n      (<span class=\"hljs-string\">'Item 2'<\/span>),\n      (<span class=\"hljs-string\">'Item 3'<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-select-from\/\">query<\/a> the <code>items<\/code> \u00a0table to verify the insert operation:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> items;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">+----+--------+\r\n| id | name   |\r\n+----+--------+\r\n|  <span class=\"hljs-number\">1<\/span> | Item <span class=\"hljs-number\">1<\/span> |\r\n|  <span class=\"hljs-number\">2<\/span> | Item <span class=\"hljs-number\">2<\/span> |\r\n|  <span class=\"hljs-number\">3<\/span> | Item <span class=\"hljs-number\">3<\/span> |\r\n+----+--------+\r\n<span class=\"hljs-number\">3<\/span> rows <span class=\"hljs-keyword\">in<\/span> <span class=\"hljs-keyword\">set<\/span> (0.00 sec)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>We have three rows with values of ID column 1, 2, and 3. Perfect! It is time to practice resetting the auto-increment value of the ID column.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1) Using ALTER TABLE statement<\/h3>\n\n\n\n<p>You can reset the auto-increment value by using the <code><a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-alter-table\/\">ALTER TABLE<\/a><\/code> statement. The syntax of the <code>ALTER TABLE<\/code> \u00a0statement to reset the auto-increment value\u00a0is as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> table_name \nAUTO_INCREMENT = <span class=\"hljs-keyword\">value<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax, you specify the table name after the <code>ALTER TABLE<\/code> clause and the <code>value<\/code> which\u00a0you want to reset to in the expression <code>AUTO_INCREMENT=value<\/code>.<\/p>\n\n\n\n<p>Notice that the <code>value<\/code> must be greater than or equal to the current maximum value of the auto-increment column.<\/p>\n\n\n\n<p>First, <a title=\"MySQL DELETE\" href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-delete\/\">delete<\/a> the last record in the <code>items<\/code> table with <code>id<\/code>\u00a0value 3:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">DELETE<\/span> <span class=\"hljs-keyword\">FROM<\/span> items\n<span class=\"hljs-keyword\">WHERE<\/span> <span class=\"hljs-keyword\">id<\/span> = <span class=\"hljs-number\">3<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>If you insert a new row, MySQL will assign 4 to the\u00a0<code>id<\/code> column\u00a0of the new row. However, you can reset the number generated by MySQL to 3.<\/p>\n\n\n\n<p>Second, reset the auto-increment value to 3 using the <code>ALTER TABLE<\/code> \u00a0statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> items AUTO_INCREMENT = <span class=\"hljs-number\">3<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, insert a new row into the <code>items<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span> items(<span class=\"hljs-keyword\">name<\/span>)\n<span class=\"hljs-keyword\">VALUES<\/span> (<span class=\"hljs-string\">'Items 4'<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Finally, retrieve data from the items table:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">SELECT * FROM items;<\/code><\/span><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">+----+---------+\r\n| id | name    |\r\n+----+---------+\r\n|  <span class=\"hljs-number\">1<\/span> | Item <span class=\"hljs-number\">1<\/span>  |\r\n|  <span class=\"hljs-number\">2<\/span> | Item <span class=\"hljs-number\">2<\/span>  |\r\n|  <span class=\"hljs-number\">3<\/span> | Items <span class=\"hljs-number\">4<\/span> |\r\n+----+---------+\r\n<span class=\"hljs-number\">3<\/span> rows <span class=\"hljs-keyword\">in<\/span> <span class=\"hljs-keyword\">set<\/span> (0.00 sec)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>We have three rows with the last auto-increment value is 3 instead of 4, which is what we expected.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2) Using the TRUNCATE TABLE statement<\/h3>\n\n\n\n<p>The <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-truncate-table\/\">TRUNCATE TABLE<\/a> statement removes all the data from a table and resets&nbsp;the auto-increment value to zero.<\/p>\n\n\n\n<p>The following illustrates the syntax of the <code>TRUNCATE TABLE<\/code> &nbsp;statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">TRUNCATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> table_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>By using the <code>TRUNCATE TABLE<\/code> \u00a0statement, you delete all data from the table permanently and reset the auto-increment value to zero.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">TRUNCATE TABLE items;<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">3) Using DROP \u00a0TABLE and CREATE TABLE statements<\/h3>\n\n\n\n<p>You can use a pair of statements: <a title=\"MySQL DROP TABLE\" href=\"https:\/\/www.mysqltutorial.org\/mysql-drop-table\">DROP TABLE<\/a> and <a title=\"MySQL Create Table\" href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-create-table\/\">CREATE TABLE<\/a> to reset the auto-increment column. Note that this method deletes all data from the table permanently.<\/p>\n\n\n\n<p>Like the <code>TRUNCATE TABLE<\/code> \u00a0statement, those statements drop the\u00a0table and recreate it, therefore, the value of the auto-increment is reset to zero. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">DROP<\/span> <span class=\"hljs-keyword\">TABLE<\/span> items;\n\n<span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> items (\n  <span class=\"hljs-keyword\">id<\/span> <span class=\"hljs-built_in\">INT<\/span> AUTO_INCREMENT,\n  <span class=\"hljs-keyword\">name<\/span> <span class=\"hljs-built_in\">VARCHAR<\/span>(<span class=\"hljs-number\">45<\/span>) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>,\n  PRIMARY <span class=\"hljs-keyword\">KEY<\/span> (<span class=\"hljs-keyword\">id<\/span>)\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this tutorial, you have learned various methods to reset auto-increment values in MySQL. The <code>ALTER TABLE AUTO_INCREMENT = value<\/code> statement is preferable as it is the easiest and has no side effects.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful? <\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"495\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/\"\n\t\t\t\tdata-post-title=\"MySQL Reset Auto Increment Values\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"495\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/\"\n\t\t\t\tdata-post-title=\"MySQL Reset Auto Increment Values\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you various ways to reset auto increment values of AUTO_INCREMENT columns in MySQL.<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":174,"menu_order":98,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-495","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MySQL Reset Auto Increment Values<\/title>\n<meta name=\"description\" content=\"In this tutorial, we&#039;ll show you various ways to reset auto increment values of AUTO_INCREMENT columns in MySQL.\" \/>\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.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL Reset Auto Increment Values\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we&#039;ll show you various ways to reset auto increment values of AUTO_INCREMENT columns in MySQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/\" \/>\n<meta property=\"og:site_name\" content=\"MySQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-31T09:22:53+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-reset-auto-increment-value\\\/\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-reset-auto-increment-value\\\/\",\"name\":\"MySQL Reset Auto Increment Values\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\"},\"datePublished\":\"2012-12-14T12:53:15+00:00\",\"dateModified\":\"2023-12-31T09:22:53+00:00\",\"description\":\"In this tutorial, we'll show you various ways to reset auto increment values of AUTO_INCREMENT columns in MySQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-reset-auto-increment-value\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-reset-auto-increment-value\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-reset-auto-increment-value\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL Basics\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MySQL Reset Auto Increment Values\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\",\"name\":\"MySQL Tutorial\",\"description\":\"A comprehensive MySQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mysqltutorial.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL Reset Auto Increment Values","description":"In this tutorial, we'll show you various ways to reset auto increment values of AUTO_INCREMENT columns in MySQL.","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.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/","og_locale":"en_US","og_type":"article","og_title":"MySQL Reset Auto Increment Values","og_description":"In this tutorial, we'll show you various ways to reset auto increment values of AUTO_INCREMENT columns in MySQL.","og_url":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/","og_site_name":"MySQL Tutorial","article_modified_time":"2023-12-31T09:22:53+00:00","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/","url":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/","name":"MySQL Reset Auto Increment Values","isPartOf":{"@id":"https:\/\/www.mysqltutorial.org\/#website"},"datePublished":"2012-12-14T12:53:15+00:00","dateModified":"2023-12-31T09:22:53+00:00","description":"In this tutorial, we'll show you various ways to reset auto increment values of AUTO_INCREMENT columns in MySQL.","breadcrumb":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-reset-auto-increment-value\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mysqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"MySQL Basics","item":"https:\/\/www.mysqltutorial.org\/mysql-basics\/"},{"@type":"ListItem","position":3,"name":"MySQL Reset Auto Increment Values"}]},{"@type":"WebSite","@id":"https:\/\/www.mysqltutorial.org\/#website","url":"https:\/\/www.mysqltutorial.org\/","name":"MySQL Tutorial","description":"A comprehensive MySQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mysqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":3,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/495\/revisions"}],"predecessor-version":[{"id":13930,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/495\/revisions\/13930"}],"up":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/174"}],"wp:attachment":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/media?parent=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}