1050 Error Table 'columns_priv' already exists

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi, I have dumped a database into the file named dbase.sql
when I am trying to recreate the database its giving the following
can any one help me in this regard?

[root@ws43 project]# vim dbase.sql
[root@ws43 project]# mysql -u "root" project < dbase.sql
ERROR 1050 at line 19: Table 'columns_priv' already exists


Re: 1050 Error Table 'columns_priv' already exists

Neo wrote:
Quoted text here. Click to load it

Your dump-file contains only create and insert commands. Create table
won't create table if such table already exist in the database. This
seems to be case.

To fix it. Either create a new database and use that. Or drop old
database and recreate it, or drop tables from the database.

I personally prefer adding these 3 lines at the beginning of the dump file:

drop database databasename;
create database databasename;
use databasename;

Warning, if you have any important data in your database which is not in
the dump file, it will be lost when drop database command is executed.

Site Timeline