0

Rename database name in mysql with queries on the server in phpmyadmin

Server mean use phpmyadmin use ip address as like a 112.121.1.12/phpmyadmin

If use this quires example->

ALTER DATABASE luck RENAME luckyj

then given this error kindly give me solution quickly

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 'RENAME luckyj' at line 1

Jon Heller
  • 33,470
  • 6
  • 70
  • 124
  • 1
    what error are you getting? – WizKid May 30 '14 at 07:22
  • 1
    See this [Thread](http://stackoverflow.com/questions/12190000/rename-mysql-database). Reaname database is not longer supported. [See here](http://dev.mysql.com/doc/refman/5.1/en/rename-database.html) – Jens May 30 '14 at 07:29
  • 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 'RENAME luckyj' at line 1 this error is show RENAME {DATABASE | SCHEMA} db_name TO new_db_name; this is also not supported and given same error and but i request give me answer in this question – user3621034 May 30 '14 at 07:35
  • may be this link will help you http://stackoverflow.com/questions/67093/how-do-i-quickly-rename-a-mysql-database-change-schema-name – ravikumar May 30 '14 at 07:39
  • Is your doubt clear? Or you want a clear answer? You can go through all the links provided in the comments which is sufficient to clear your doubt – Riq May 30 '14 at 07:52
  • Check this: http://stackoverflow.com/a/21429268/925144 – Sathish D May 30 '14 at 08:18

1 Answers1

0

Firstly, your query is wrong.

The syntax for renameing a database is

RENAME {DATABASE | SCHEMA} db_name TO new_db_name;

Check this link and you will come to know that there are some known issues hence MySQL removed the support for RENAME even if you have the version which supports renaming DATABASE, your query is wrong hence it won't work.

Solution:

  1. Check If you have the supported version.
  2. Change the query
Community
  • 1
  • 1
NewUser
  • 3,629
  • 7
  • 53
  • 76