MySQL Forums
Forum List  »  Newbie

Re: #1050 table exsists already error when importing db
Posted by: Peter Brawley
Date: August 29, 2017 10:14PM

> I clear the folder that had the older database in it

Good grief. Do not do that.

A database is stored in files, but a table is not a file, it's a database object. A database cannot be managed as if it were just a file system.

Use SQL commands to drop tables. Reserve direct file manipulation for emergencies, and do it only when what you're doing has been reputably documented and when you know what you're doing.

Depending on what engine your tables use, and what your my.cnf/ini settings are, you may have screwed your database so completely that you'll need to restore from a mysqldump backup. I'd start by shutting down the MySQL server, restoring the deleted files from the recycle bin, then restarting the server to see if the database survived your blunder. If they did, you escaped. If they didn't, you'll need to restore from a backup.

As for the error you're getting, it just means that the mysqldump script you ran was configured to include unconditional Create Table statements, but tables referenced by those statements already existed. See the mysqldump manual page for how to configure mysqldump to either drop and recreate each table, or suppress Create Table statements altogether.

Options: ReplyQuote

Written By
Re: #1050 table exsists already error when importing db
August 29, 2017 10:14PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.