I am scripting out the creation of a database so I can make changes and then
run the script to generate a clean copy (by running it in MySQL Query
Browser).

The script DROPs all the tables, then CREATEs them again along with all the
indices and whatnot.  However, if I run the script after having run it once
(if I close the Query Browser and then open it again and reload the script
later), I get error 1061 "Duplicate key name" on all of the indices.

So I figured I missed something, and I'll just DROP the whole database and
then run the script.  I add a "DROP DATABASE databasename;" and a "CREATE
DATABASE databasename;" at the start of my script and try to run it again.
Now I get errors 1008 "Can't drop database 'databasename'; database doesn't
exist" and 1007 "Can't create database 'databasename'; database exists",
followed by the index errors above.

If I drop the database from MySQL Administrator (or the command-line
client), and then run the script again I get the same errors.  The database
and all of the scripted objects are created (properly as far as I can tell),
but why would I get these errors?

I am using the latest version of MySQL (5.0.19) with InnoDB as the storage
engine on Windows 2000 Professional SP4, but I have the same problem with
5.0.17.

If there is any other information you need I'd be happy to supply it.

Reply via email to