How To Reset Table Auto Increment Column Id In MySQL (PHPMyAdmin)

Поділитися
Вставка
  • Опубліковано 24 жов 2024

КОМЕНТАРІ • 111

  • @WordPressWisdom
    @WordPressWisdom 3 роки тому +2

    Saved me the stress of setting new auto increment and importing again a record of over 900K. Thank you. Thank you! Indeed learning never stops.

  • @mijail619
    @mijail619 3 роки тому +44

    set @autoid :=0;
    update employee set id = @autoid := (@autoid+1);
    alter table employee Auto_Increment = 1;

  • @infernogaming9504
    @infernogaming9504 11 місяців тому +1

    If i use this statement with servlet that would work ? After deleting specific data ?

  • @hafsasifeddine9198
    @hafsasifeddine9198 Рік тому

    thank you so much for this tuto i can't believe that you released this life saver 6 years ago .

  • @terrillchristians
    @terrillchristians 5 місяців тому

    thanks excellent video- i used the first formula to change the current records ensure the new records created would follow that number sequence

  • @GaneshBisoi-tm2lm
    @GaneshBisoi-tm2lm Рік тому

    Thank you so much sir for this video.

  • @kingprince1860
    @kingprince1860 4 роки тому

    Merci, j'ai galéré un moment avant de tomber sur ta solution

  • @JamesBond-gw7hc
    @JamesBond-gw7hc Рік тому

    Will the row being in auto increment and correct serial numbers?

  • @jayasuriya4194
    @jayasuriya4194 3 роки тому

    thank you for your answer.big helpful for this video.

  • @joydeepbhattacharjee5305
    @joydeepbhattacharjee5305 4 роки тому

    thank u so much sir...very helpful video

  • @abrar4093
    @abrar4093 2 роки тому

    thanks allot sir ...
    this is very helpfulllllllllllllllllllllllllllllllllllllllllllllll

  • @stiveroncal2735
    @stiveroncal2735 4 роки тому

    greeting from Peru THANK YOU

  • @gcastelt_ideas_libertarias
    @gcastelt_ideas_libertarias 4 роки тому

    thank you! Greetings from Venezuela

  • @davileo5392
    @davileo5392 4 роки тому

    tnx homey u saved ma time

  • @liftedup299
    @liftedup299 2 роки тому

    Thank you for helping me!

  • @ramiro041
    @ramiro041 3 роки тому

    thank you, it work without a hitch

  • @feryelaco7320
    @feryelaco7320 6 років тому +1

    thank you! Greetings from Panama

  • @loicnicolas4598
    @loicnicolas4598 4 місяці тому

    fine, but how can you do it automatically for a project, for example?

    • @HarithaComputersTechnology
      @HarithaComputersTechnology  4 місяці тому

      The same procedure you have implement, just change the connection string according to your remote database thanks

  • @Twowheeleetales
    @Twowheeleetales 3 роки тому

    thanks sir

  • @clipfarma
    @clipfarma Рік тому

    Thank You Sir You Reduced My Stress 💗💖🥺

  • @soumikbasu6510
    @soumikbasu6510 3 роки тому

    thanks for the help

  • @freelancertahsan9403
    @freelancertahsan9403 2 роки тому

    It's Working! Thank you so much!

  • @playinggaming1509
    @playinggaming1509 3 роки тому

    thank you

  • @McMaEl24
    @McMaEl24 4 роки тому

    Thank you! Helped so much!

  • @gautamkumar-if5yf
    @gautamkumar-if5yf 6 років тому

    Thanks alot to give such solution..

  • @tejasjadhao4963
    @tejasjadhao4963 4 місяці тому

    I have done as you instructed and then after last alter command I deleted the row and again inserted row but the same problem is coming

  • @thedevcristian
    @thedevcristian 4 роки тому

    Thank you! Stay safe

  • @jawadlee273
    @jawadlee273 6 років тому

    Very Helpful to me......

  • @mrdsmind5908
    @mrdsmind5908 3 роки тому

    THANKS

  • @pipettta
    @pipettta 4 роки тому +1

    Absolutely usefull, thanks a lot mate!

  • @bimsarasenarath2665
    @bimsarasenarath2665 4 роки тому

    Thankz. Its worked.

  • @ahmedmahfadi1631
    @ahmedmahfadi1631 4 роки тому

    Thank you very much for this video.

  • @bennylee3145
    @bennylee3145 3 роки тому

    you don't use DBCC CHECKIDENT(tableName, RESEED, 0) ?

  • @ramiro041
    @ramiro041 3 роки тому +1

    it would be very usefull if you include the code in the description so as to copy paste it

  • @matthewthemobiledj
    @matthewthemobiledj 5 років тому

    Big Thanks from England

  • @محمدمطاوع-ل2ل
    @محمدمطاوع-ل2ل 4 роки тому

    Great job
    thank you

  • @dennischarles4384
    @dennischarles4384 3 роки тому

    Thanks indeed!

  • @mohammadsulaibi9
    @mohammadsulaibi9 4 роки тому

    thanks very much

  • @1966Ally
    @1966Ally 3 роки тому

    Thank you, lifesafer!

  • @phiwayinkosivictor2890
    @phiwayinkosivictor2890 5 років тому

    Thank you soo much

  • @raghavaggarwal2418
    @raghavaggarwal2418 6 років тому

    pls tell me agr mai koi bhi record del krta hun toh automatically ids update hojaye aisa kuch bta sakte ho

  • @ekkkogo2413
    @ekkkogo2413 5 років тому

    Nice thank you Sir

  • @shivay4573
    @shivay4573 5 років тому

    Thank you sir

  • @carlosmaralit2397
    @carlosmaralit2397 6 років тому

    thank you very much very helpful :)

  • @hungcao1342
    @hungcao1342 3 роки тому

    nice !

  • @vazap9026
    @vazap9026 7 років тому

    Thank you!

  • @jhayjhayidmilao5612
    @jhayjhayidmilao5612 6 років тому +1

    thankyou bro

  • @Barijj17
    @Barijj17 7 років тому

    Thank you so much buddy

  • @tutorialsonly4654
    @tutorialsonly4654 5 років тому

    Thanks man it helped!

  • @zaidkureshi8587
    @zaidkureshi8587 6 років тому

    informative

  • @kogashinto2123
    @kogashinto2123 2 роки тому +1

    SET @autoid :=0;
    UPDATE table_name SET id = @autoid := (@autoid+1);
    ALTER TABLE table_name Auto_Increment = 1;

  • @business1442
    @business1442 3 роки тому

    better~❤

  • @tibeyisaac7431
    @tibeyisaac7431 4 роки тому

    Please I want to keep old records and restart auto ID 1. How do I do that ?

  • @kumaresha3348
    @kumaresha3348 4 роки тому +1

    How to make id restart after deleting middle record in C# with MySQL.

  • @consoledoterror971
    @consoledoterror971 4 роки тому

    What if this table has relation with other. Won't it going to be a big mess.

  • @thealchemist8212
    @thealchemist8212 4 роки тому

    Sir in my database, subs_id always start with serial number 0, so the next entry data could not be filled, what should I do sir???

    • @landofabraham
      @landofabraham 4 роки тому

      Stop the Illegal War in the name of Peaceful War worldwide. Control your Americal. Mike 😕

  • @mesajjadnadir
    @mesajjadnadir 6 років тому

    thank you :)

  • @palalopea592
    @palalopea592 6 років тому +1

    thanks xoxo :D

  • @pedhmaplakaielf
    @pedhmaplakaielf 6 років тому

    I try it on phpmyAdmin it work! but when I try it on SQLI mysqli_query isn't they said You have an error in your SQL syntax.
    what I do something worng plese halp me.
    $q = "DELETE FROM plants WHERE pro_id='$pro_id';
    SET @autoid :=0;
    Update plants set pro_id='$pro_id' = @autoid :=(@autoid+1);
    alter table plants Auto_increment =1";
    $result = mysqli_query($dbcon,$q);

  • @anggiawanprasetyo8609
    @anggiawanprasetyo8609 5 років тому

    Thankyou :)

  • @destoniusdhiraviam4643
    @destoniusdhiraviam4643 4 роки тому +2

    How to use this query in php.?

  • @cengusanadorsito
    @cengusanadorsito 6 років тому

    Thanks (Y)

  • @tejasjadhao4963
    @tejasjadhao4963 4 місяці тому

    Still I m having same problem

  • @xx0bb
    @xx0bb 3 роки тому

    Warning: #1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
    how to type code then ?

  • @jonathancostantini7189
    @jonathancostantini7189 4 роки тому

    how to execute this in c#?

  • @cryptobuzzz8703
    @cryptobuzzz8703 2 роки тому

    How to restore posts from phpmyadmin after being deleted permanently from trash?

  • @palalopea592
    @palalopea592 6 років тому

    how about in sqlite? please help me

  • @asc_chimuarufa
    @asc_chimuarufa 4 роки тому +5

    Real Challenge. Same Problems Every Time
    We know that we can "always" reset the auto-increment column
    BUT
    eventually, you will have the same problem again and again.
    Question.
    Can you make an auto-reset auto increment?
    FOR EXAMPLE
    ID NAME
    1 BOB
    2 JOHN
    3 SERA
    #1 delete some users
    ID NAME
    1 BOB
    3 SERA
    #2 add a new user
    1 BOB
    3 SERA
    4 MIKE
    use the manual auto-increment reset
    Then the same issue happens again. (See for example)
    Is there any way that the database can auto-reset the auto-increment so the problem will not happen again?

  • @Twowheeleetales
    @Twowheeleetales 3 роки тому

    set @autoid :=0;
    update TABLE_NAME set id = @autoid := (@autoid+1);
    alter table TABLE_NAME Auto_Increment = 1;

  • @gudiputisairam346
    @gudiputisairam346 4 роки тому

    i got this error Pleases Help Some:(
    Error
    SQL query:
    update loginapp set id = @autoid := (@autoid+1)
    MySQL said: Documentation
    #1146 - Table 'loginapp.loginapp' doesn't exist

  • @bnr_sports
    @bnr_sports 2 роки тому

    $query= "DELETE FROM ".$tableName." WHERE ".$conditionData SET @autoid :=0; UPDATE live SET id = @autoid := @autoid+1; ALTER TABLE live AUTO_INCREMENT = 1;
    any one pls correct it

  • @fmgraphicdesign76
    @fmgraphicdesign76 4 роки тому

    Thanks a lot

  • @dragoljubbrajovic9337
    @dragoljubbrajovic9337 7 років тому

    Thank you !!