Entry
How can I rename a database?
May 18th, 2005 12:22
Michael Phipps, Nathan Wallace, Daniel Beckham, Thimble Smith, Sinisa Milivojevic
LINUX/UNIX
Stop the MySQL Server.
Find the data directory that stores the database. If you don't know
where that is, try:
$ mysqladmin variables | grep datadir
Rename the directory that stores the database to the new name you want
to use for the database.
Now restart the MySQL server.
You will have to check any grant permissions for the database... They
still might contain references to the old databse name !!
WINDOWS XP
Stop the MySQL Server:
- Open Control panel / administration tools / services
- Select Mysql, and press stop
Find the data directory that stores the database. In a default
install, it will most likely be in C:\Program Files\MySQL\MySQL Server
4.1\data
Rename the directory that stores the database to the new name you want
to use for the database.
Now restart the MySQL server:
- Use Control panel / administration tools / services
- Select Mysql, and press start
You will have to check any grant permissions for the database... They
still might contain references to the old databse name !!
If YOU have directions for any other Operating Systems, please feel
free to add them!