Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

How to reset auto increment in MySQL - by bigquery.com

Loading...

Sign in or sign up now!
1,693
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 15, 2009

ในการสร้าง table ใน database หลายๆ ครั้งที่เรากำหนดให้ primary key เป็น integer แบบ AUTO_INCREMENT หมายถึงทุกครั้งที่เราเพิ่มข้อมูลในตารางนี้ ตัวเลขใน field นี้จะมีค่าเพิ่มขึ้นทีละ 1 โดยอัตโนมัติ รวมถึงข้อมูลที่เราใช้ทดสอบในตอนที่เราทดสอบระบบ หากต้องการเริ่มต้น หรือ reset การนับใหม่ทำอย่างไรดีหละ มาดูกัน

ง่าย ๆครับ ดังนี้ ถ้าใช้ phpMyAdmin ก็คลิกที่ Empty ได้เลย หรือไม่ก็เข้าไปที่
หรือใช้คำสั่ง SQL TRUNCATE
TRUNCATE TABLE "table_name"

http://www.bigquery.com/

Category:

Education

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:
see all

All Comments (5)

Sign In or Sign Up now to post a comment!
  • กระจอกมากครับ

    

  • I dont need that shit in my life ,,,,he or she even Dont know how to use sql or oracle,,,Damn

  • damn you ruined my record.. now i have to create dummies again

  • YES.. BUT it delete all users!!!

  • The music is disturbing. It's so out-of-the-world. Sorry. O_o

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more