Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4535948
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:28:11+00:00 2026-05-21T14:28:11+00:00

Assume I have a reports table with an id int auto_increment column that serves

  • 0

Assume I have a reports table with an id int auto_increment column that serves as the primary key.

If I mysqldump this table into a file with drop table and create table instructions added, and then I load it into another database B which is just like A but missing a few of the newest reports records, does database B end up with an exact copy of database A’s reports table?

what if the drop table and create table instructions were missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:28:12+00:00Added an answer on May 21, 2026 at 2:28 pm

    The auto_increment column’s data is preserved as is.

    Try doing a mysqldump to a single table and view how the column is inserted.

    Also note that the table definition of each table keeps the next auto_increment value while the previous values are included in the list of VALUES. Here is a sample:

    mysql> create database test;
    Query OK, 1 row affected (0.06 sec)

    mysql> use test
    Database changed
    mysql> create table tb (name char(10),id int not null auto_increment primary key) ENGINE=MyISAM;
    Query OK, 0 rows affected (0.13 sec)

    mysql> insert into tb (name) values (‘John’),(‘Mary’),(‘Joseph’);
    Query OK, 3 rows affected (0.05 sec)
    Records: 3 Duplicates: 0 Warnings: 0

    mysql> select * from tb;
    +——–+—-+
    | name | id |
    +——–+—-+
    | John | 1 |
    | Mary | 2 |
    | Joseph | 3 |
    +——–+—-+
    3 rows in set (0.03 sec)

    I performed a mysqldump of the test database and here is what it produced:

    DROP TABLE IF EXISTS tb;
    /*!40101 SET @saved_cs_client = @@character_set_client /;
    /
    !40101 SET character_set_client = utf8 */;
    CREATE TABLE tb (
    name char(10) DEFAULT NULL,
    id int(11) NOT NULL AUTO_INCREMENT,
    PRIMARY KEY (id)
    ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
    /*!40101 SET character_set_client = @saved_cs_client */;

    —
    — Dumping data for table tb
    —

    LOCK TABLES tb WRITE;
    /*!40000 ALTER TABLE tb DISABLE KEYS /;
    INSERT INTO tb VALUES (‘John’,1),(‘Mary’,2),(‘Joseph’,3);
    /
    !40000 ALTER TABLE tb ENABLE KEYS /;
    UNLOCK TABLES;
    /
    !40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

    Give it a Try !!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume that we have two tables: Roles and Reports . And there exists a
Assume I have a table that has the following structure: ================= | Id |
Assume I have a function template like this: template<class T> inline void doStuff(T* arr)
Assume I have an ASP.NET MVC app that's not doing anything too fancy (no
Assume we have a method like this: public IEnumerable<T> FirstMethod() { var entities =
Lets assume we have this xml: <?xml version=1.0 encoding=UTF-8?> <tns:RegistryResponse status=urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure xmlns:tns=urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0 xmlns:rim=urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0> <tns:RegistryErrorList
I have a table containing reports and the date/time they were created. I'd like
Assume I have the following XML file: <Movies> <Movie ownerName=Ryan> <Title>The Lord of the
I have a hierarchical list of objects. Assume that the structure is as follows:
Assume I have a class foo, and wish to use a std::map to store

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.