How can I rename the MySQL database name using query?
I tried rename database via phpmyadmin and getting the following error,
SQL query:
RENAME DATABASE test TO test_bkp
MySQL said:
#1064 - 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 test To test_bkp' at line 1
It says here that:
You can import all data into a new database then delete the old one.
It is also possible to use the
RENAME TABLEstatement using same from/to table name but different from/to database. There are a few catches.