How can i delete duplicate rows in my database name ( VB) included 255 tables using ALTER TABLE in PHP my admin ?
1 Answer
You can try to add unique index like this:
ALTER IGNORE TABLE tablename ADD UNIQUE INDEX idx_name (columnname1,columnname2 );
This query will drop all the duplicate rows from your table and it will also restrict users to add duplicate rows in future in the table.
3 Comments
Mohammad Ahmad Al Ajouri
Error SQL query: ALTER IGNORE TABLE vb ADD UNIQUE INDEX idx_name (columnname1,columnname2 ) MySQL said: Documentation #1146 - La table 'vb.vb' n'existe pas
Rahul Tripathi
@MohammadAhmadAlAjouri:- 1. Please translate the error in English. 2. You need to mention the column name present in your table not columnname1 and columnname2. These are examples
Mohammad Ahmad Al Ajouri
*****@p3plcpnl0192 [~]$ mysqldump -u vbok -p --hex-blob --opt --default-character-set=latin1 vbok > new.sql Enter password: mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table
post at row: 63755 wwwowtjo@p3plcpnl0192 [~]$