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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.