SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Auto_increment

  1. #1
    SitePoint Member
    Join Date
    Jan 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Auto_increment

    I am trying to load a 4.1 database into 5.x and having issues. I keep getting errors on a few queries on one table. The only difference I see between the versions is when I do SHOW CREATE TABLE table the two have different endings ..

    The 4.1 that works fine has;
    ) ENGINE=MyISAM DEFAULT CHARSET=latin

    5.x version that errors out has;
    ) ENGINE=MyISAM AUTO_INCREMENT=4141 DEFAULT CHARSET=latin1

    I loaded the database doing a mysqldump on 4.1 and loading it on 5.x doing on mysql -u user -p db < file.sql

    Why is 5.x addding AUTO_INCREMENT=4141 and how can I stop it?

  2. #2
    SitePoint Wizard HarryR's Avatar
    Join Date
    Dec 2004
    Location
    London, UK
    Posts
    1,376
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use the --compatible option to output SQL compatible with older versions or other databases entirely.

    For example:
    Code:
    mysqldump --compatible=mysql40

  3. #3
    SitePoint Member
    Join Date
    Jan 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So if I want to dump a 4.1 database to migrate to 5.x I should use that command?

    mysqldump --compatible=mysql40

  4. #4
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    if you're going up, then no options are needed.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •