Results 1 to 5 of 5

Thread: Zeroing a MySQL database

  1. #1
    Join Date
    Jan 2008
    Posts
    55
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Zeroing a MySQL database

    I have imported the database structure of a MySQL database onto RFH. I deleted all the users listed before the export, however adding a new user after the import the entry was sequential from the last one deleted on the previous host. I'd like it to start again from 1, is there an easy way this can be done?

  2. #2
    Join Date
    Feb 2006
    Location
    UK
    Posts
    31
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Not a MySql expert, but...

    A Truncate Table usually resets identity columns - not sure if that's the case with MySql, (I'm a MS Sql Server bod), but might be worth a shot.

    Regards,
    Jim.
    www.PatternSoft.co.uk
    Specialist providers of marketing and data services to small and medium sized companies.

  3. #3
    Join Date
    Jan 2006
    Posts
    419
    Thanks
    2
    Thanked 16 Times in 16 Posts

    Default

    in sql server you can set the starting position for an identity column would need to look for similiar in mysql

  4. #4
    Join Date
    May 2005
    Location
    Rugby, UK
    Posts
    69
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    There are a few suggestions on this page,
    http://dev.mysql.com/doc/refman/5.0/...increment.html

    I've not tried any of them, so I can't say if they work or not.

  5. #5
    Join Date
    Jan 2008
    Posts
    55
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Problem Solved - I think!

    Within phpMyAdmin for each table there is an empty function - which appears not to work if you have already manually deleted the data; this however I presume would clear the entries of that table.

    You've also an 'operations' tab. Within that you have table options. My users table still had me and one other as an admin. I set 'auto_increment to 3 added another user and it worked. User number 3!

    Some of the other tables have no data, so I'm presuming 1 is to be used for auto_increment, where there is data, I've set the auto_increment to the next consecutive number.

    Thanks to everyone offering advice....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Database backup
    By heavenlyarts in forum Technical Support
    Replies: 4
    Last Post: 13th September 2007, 07:17 PM
  2. How do I restore a backup of a mysql database?
    By Roger N Doubt in forum MySQL
    Replies: 0
    Last Post: 21st December 2006, 12:11 PM
  3. Database
    By nikkidodd in forum Customer Feedback and Suggestions
    Replies: 0
    Last Post: 11th November 2006, 07:17 PM
  4. Database Backup
    By andyj in forum MSSQL
    Replies: 2
    Last Post: 23rd March 2006, 09:30 AM
  5. How to copy a MySql database ?
    By JohnHorne in forum MySQL
    Replies: 4
    Last Post: 6th November 2005, 12:31 PM

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
  •