List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 30 2002 7:31pm
Subject:Re: renaming a database
View as plain text  
At 11:10 -0800 1/30/02, JC wrote:
>Hash: SHA1
>I'm kind of interested to find if there is a way to rename a database
>with something like the alter command.
>Looking in the index of the New Riders MySQL book I don't see
>anything other than renaming tables
>Looking through the Manual for  version 3 Nothing shows up
>Looking at the mailing list archieve I don't see anything either
>I'm running 3.23.46-nt running on windows 2000 advanced server as a
>I'm thinking that the only way around this would be to do a mysqldump
>for that database and then creating a new database with the desired
>name and importing the contents of the dump file.
>I'd like to be able to just rename the database from the command line
>just like you would a table.

If your database doesn't contain InnoDB tables, you can try this:

- Shut down the MySQL server
- Rename the database directory
- Restart the MySQL server

But remember that if you have entries in the grant tables that pertain
specifically to that database, you'll need to update them to use the
new database name.

>Thanks in advance,

renaming a databaseJC30 Jan
  • Re: renaming a databasePaul DuBois30 Jan
  • Re: renaming a databaseNathan30 Jan
Re[2]: renaming a databaseDmitry Alyabyev31 Jan