Please wait while we load your page...

PasswordSentry

Latest Version [8.00202205221] Last Updated [May-22-2022]

Webmaster Tutorials

Definition [Reorder Primary Key]

Protect Your Website Today
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.

Random Security Blog Articles



PasswordSentry :: Security Blog ArticleTechnology that can produce deepfakes is widely available. (Shutterstock) Sze-Fung Lee, McGill University and Benjamin C. M. Fung, McGill University https://narrations.ad-auris.com/widget/the-conversation-canada/the-use-of-deepfakes-can-sow-doubt–creating-confusion-and-distrust-in-viewers In early March, a manipulated video of Ukrainian President Volodymyr Zelenskyy was ciruclated. In it, a … Read More
PasswordSentry :: Security Blog ArticleLarge language model AI responds to questions but doesn’t actually know anything and is prone to making things up. Charles Taylor/iStock via Getty Images Chirag Shah, University of Washington The prominent model of information access before search engines became … Read More
PasswordSentry :: Security Blog ArticleHacks like the one on Coincheck expose gullible investors to risk, but it also means funds could be flowing undetected into the hands of money launderers and terrorists. www.shutterstock.com Philippa Ryan, University of Technology Sydney New risk rules for … Read More


Live Chat Offline