Results 1 to 2 of 2

Thread: importing table into database using phpmyadmin

  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    1
    cPanel/WHM Access Level

    Website Owner

    Default importing table into database using phpmyadmin

    Hi,

    I need to restore a table. So I log into cpanel/phpmyadmin, choose table T and hit "import". Then I
    import the backup for table T.

    I get this:
    #1062 - Duplicate entry '1674' for key 1

    I am wondering if phpmyadmin replaces table T with the backup or adds both (which creates duplicates).

    Thing is when I import the whole backup database the same way, phpmyadmin dumps the old database
    and replaces it with the backup. So what did I miss ?

    Thanks if you can help..

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: importing table into database using phpmyadmin

    MySQL itself tries to import entries without dropping the old data, which causes duplicates. This is why you'd need to import the table with the sql having had --add-drop-table flag for the creation. If it doesn't have that, it doesn't first drop the table to then import the new one.

    You could always just drop the table before trying to add it to get around that. You have a backup, it appears, so hopefully dropping the table won't cause any issues.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads

  1. phpMyAdmin access denied importing cvs
    By Sash in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 03-15-2010, 05:06 PM
  2. Importing backup.sql into phpMyAdmin
    By GoWilkes in forum Database Discussions
    Replies: 1
    Last Post: 01-18-2010, 03:25 AM
  3. Replies: 23
    Last Post: 06-09-2008, 03:35 PM
  4. Importing large MYSQL database
    By greenchicken in forum Database Discussions
    Replies: 3
    Last Post: 04-26-2006, 08:41 PM
  5. phpMyAdmin access denied importing cvs
    By equens in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 08-24-2004, 10:09 AM