Jump to content

[SOLVED] Renaming a DB and restarting MySQL


Arez

Recommended Posts

I've been trying to rename a DB, but haven't found out how. The best I know of is to go into the directory the databases are stored, and rename the folder itself. They say that you should restart MySQL after that process though.

 

So, is there another way to rename the DB, and how do I restart MySQL??

Not sure if this will help or not

 

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 !!

 

Source: http://www.faqts.com/knowledge_base/view.phtml/aid/1262

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.