Please wait while we load your page...

PasswordSentry

Latest Version [8.00202307241] Last Updated [Jul-24-2023]

PasswordSentry Highly Recommends NETbilling
Home




Reorder Primary Key



You can reorder a primary key (e.g., ID) by execcuting the following three(3) mySQL queries (via command line or app like phpMyAdmin):

ALTER TABLE `tbl` DROP `col`;
ALTER TABLE `tbl` AUTO_INCREMENT = 1;
ALTER TABLE `tbl` ADD `col` int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;

- Replace tbl with the name of your database table.
- Replace col with the name of the column in the database table you are reordering.

Warning: Do NOT reorder a column if another database table uses that same column for reference. Otherwise, the tables will be out of sync.
Once changed, the changes cannot be undone. Always backup your database table before you make sweeping changes like this. That way,
if anything goes wrong, you can restore the database table from your backup.
Blog Posts

Random Security Blog Articles



See All Blog Posts


PasswordSentry :: Security Blog ArticleBlindly eliminating biases from AI systems can have unintended consequences. Dimitri Otis/DigitalVision via Getty Images Emilio Ferrara, University of Southern California When I asked ChatGPT for a joke about Sicilians the other day, it implied that Sicilians are stinky.… Read More
PasswordSentry :: Security Blog Articleseaonweb/Shutterstock Christopher J. Finlay, Durham University In conventional warfare, it’s accepted that if a state finds itself under attack, it’s entitled to respond – either with defensive force, or with a counterattack. But it’s less clear how countries should … Read More


Live Chat Offline