Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL 5.0 - How to rename database?

Status
Not open for further replies.

Ator

Programmer
Jan 23, 2006
26
SE
Hi folks!

I have installed MySQL 5.0 (windows).
I also have installed the tool "MySQL Query Browser".

Now I want to rename a database in MySQL Query Browser.
I've tried with "RENAME DATABASE test2 TO test1", but it does not work. I get the error:
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE test2 TO test1' at line 1"

I have also tried with "RENAME SCHEMA" but it did not success either.

I also tried to execute these in "MySQL Command Line Client" with a failure.

To solve this another way, I tried to rename the directory ".../mysql/data/test2" to ".../mysql/data/test1", but then the table connections was lost.

Does anyone know how to simply rename a database/schema?
 
Ok, thanks TowerBase!

I can not understand why they have left out that statement in earlier versions...

I think that "feature" is very very basic...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top