Change group ID number?
-
So I made 2 groups, deleted them, and now the numbering order starts at 3.
is there an easy way to switch the number counter back to 1?
-
@vince-villarreal If you have no groups at all, this will work:
ALTER TABLE groups AUTO_INCREMENT = 1;
but if you have any groups at all, this will probably break stuff. -
so I am a noob, where do I type that in at? (tried in mysql)
-
@wayne-workman said in Change group ID number?:
ALTER TABLE groups AUTO_INCREMENT = 1;
also I am using Maria DB not MYSQL
-
@wayne-workman so I type in console:
mysql fog
ALTER TABLE groups AUTO_INCREMENT = 1;
nothing happens
Then i try it with the \G command at the end (\G = send command to mysql server)
it throws back:
Query OK, 0 rows affected
Records: 0 Duplicates: 0 Warnings: 0
ERROR: No query specified -
@vince-villarreal said in Change group ID number?:
Query OK, 0 rows affected
Records: 0 Duplicates: 0 Warnings: 0
ERROR: No query specifiedThis message is expected based on your query (it ran OK). You didn’t update or select any rows from the database. You altered a table descriptor.
-
@vince-villarreal I’ll ad \G should not be used with ;, for example:
alter table fog.groups auto_increment = 1\G;
is trying to run two separate queries, one for the alter table and one that is blank, hence the error no query message.\G is a means to display columns in a vertical format where ; will show each row horizontally.
-
@vince-villarreal Try to add a group and see what the ID is.