I deleted ID 2 from mySQL db, but then I have the following to AUTO INCREMENT
import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="root",
password="password",
database="Users"
)
mycursor = mydb.cursor()
SQL = "ALTER TABLE users MODIFY id INTEGER NOT NULL AUTO_INCREMENT"
mycursor.execute(SQL)
mydb.commit()
myresult = mycursor.fetchall()
for x in myresult:
print(x)But when I do this, it displays the database, but its not AUTO INCREMENT, ing. the ID goes from 1-3, it skips 2.SQL = "SELECT * FROM users"
Output:('Peter', 'Lowstreet 4', 1)
('Hannah', 'Mountain 21', 3)
('Michael', 'Valley 345', 4)
('Sandy', 'Ocean blvd 2', 5)
