Faqts : Computers : Databases : MySQL : Tips and Tricks

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

65 of 81 people (80%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How can I rename a database?

Sep 15th, 2009 02:30
jick heir, 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!
http://sundhedernaeringguide.blogspot.com/
http://zdravevyzivypruvodce.blogspot.com/
http://guidasalutenutrizione.blogspot.com/
http://gesundheiternahrungpflege.blogspot.com/
http://soinssantenutrition.blogspot.com/
http://zdravljeprehranavodic.blogspot.com/
http://healthnutritionhoito.blogspot.com/
http://hlhnutgr.blogspot.com/
http://gezondheidvoedinggids.blogspot.com/
http://taplalkozas-egeszsegugyikezikonyv.blogspot.com/
http://hlthnutbg.blogspot.com/