Title: SQL Error 1062
Last modified: August 19, 2016

---

# SQL Error 1062

 *  Resolved [nsuydam1](https://wordpress.org/support/users/nsuydam1/)
 * (@nsuydam1)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sql-error-1062/)
 * Hello all,
 * I’m having problems restoring my database from a backup. I changed my hosting
   account to a different url, and I want to upload my content again. I backed up
   everything, and have started uploading from myPHPadmin, but I get this error:
 * SQL query:
 * INSERT INTO `wp_bas_refer`
    VALUES ( 2520, ‘…flickr address…’ ) ;
 * MySQL said: Documentation
    #1062 – Duplicate entry ‘2520’ for key 1
 * I’ve searched high and wide for an answer, but I can’t seem to come up with anything
   that helps. Any ideas?
 * Thanks!
 * Nick S.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sql-error-1062/#post-1552418)
 * Looks like that entry already exists in the wp_bas_refer table.
 *  Thread Starter [nsuydam1](https://wordpress.org/support/users/nsuydam1/)
 * (@nsuydam1)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sql-error-1062/#post-1552424)
 * Any idea how to correct that? Can I just delete that entry somehow?
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sql-error-1062/#post-1552427)
 * You can delete rows from phpMyAdmin.
 * Back up your database first!
 * Just click on the table you want to change so the rows are showing. Then, click
   the red X next to a row.
 * If you want to delete multiple rows, mark the ones to delete in the check-boxes,
   then scroll down to the bottom of the list and click the red X there.
 *  Thread Starter [nsuydam1](https://wordpress.org/support/users/nsuydam1/)
 * (@nsuydam1)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sql-error-1062/#post-1552428)
 * Thanks! But I just tried deleting entry 2520 from the wp_bas_refer file as you
   explain above, and then uploading the backup file again, and I get the same error,
   same entry and everything. This is getting pretty annoying!
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sql-error-1062/#post-1552445)
 * Well, you may have duplicate rows in your backup file.
 *  Thread Starter [nsuydam1](https://wordpress.org/support/users/nsuydam1/)
 * (@nsuydam1)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sql-error-1062/#post-1552500)
 * Thanks, yep seems to have worked! Can’t believe I didn’t think of that sooner….
 * Thanks again,
 * Nick
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sql-error-1062/#post-1552515)
 * You are welcome!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘SQL Error 1062’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/sql-error-1062/#post-1552515)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
