Renaming Mysql Database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Gopesh
Forum Contributor
Posts: 143
Joined: Fri Dec 24, 2010 12:48 am
Location: India

Renaming Mysql Database

Post by Gopesh »

Hi,i want to rename my current database to another one.is it possible in mysql? Version of mysql is 5.1.36.
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Renaming Mysql Database

Post by Apollo »

Gopesh
Forum Contributor
Posts: 143
Joined: Fri Dec 24, 2010 12:48 am
Location: India

Re: Renaming Mysql Database

Post by Gopesh »

Thanks Apollo for ur reply.RENAME option doesn't works for me.
Gopesh
Forum Contributor
Posts: 143
Joined: Fri Dec 24, 2010 12:48 am
Location: India

Re: Renaming Mysql Database

Post by Gopesh »

Should anyone have the knowledge about renaming mysql database????Pls share about it...
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Renaming Mysql Database

Post by califdon »

Don't even try to use RENAME. As those references state, it can cause damage to your database. The fact is, renaming a MySQL database is not a simple task due to the internal tables that MySQL uses to store metadata about the database. If it is really important to rename your database, you will probably have to essentially execute a full SQL dump of your structure and data, and use that to recreate a new database with the name you want. That's a lot of work to go through (with all the opportunities for errors), so you shouldn't do it unless it's really important.
Gopesh
Forum Contributor
Posts: 143
Joined: Fri Dec 24, 2010 12:48 am
Location: India

Re: Renaming Mysql Database

Post by Gopesh »

Thanks califdon for ur reply.RENAME option doesn't works for me but now am happy with that !!!!.I copied the database to a new database with the name i want to give it(for rename).it is very simple from the graphical support of phpmydmin in wamp sever.And i switched to that database.it works fine for me...Thanks to all....
Post Reply