0

RENAME DATABASE sample TO sample_db;

1 queries executed, 0 success, 1 errors, 0 warnings

Query: RENAME DATABASE sample TO sample_db

Error Code: 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 sample TO sample_db' at line 1

Execution Time : 0 sec Transfer Time : 0 sec Total Time : 0.001 sec

Shadow
  • 32,277
  • 10
  • 49
  • 61
  • 2
    Why did you suppose there is a RENAME DATABASE statement? Did you read this in the MySQL documentation or see any example of it? – Bill Karwin Jun 27 '20 at 18:31
  • Alter may work but...not sure – dan1st Jun 27 '20 at 18:33
  • @BillKarwin there used to be for a very-very short period of time. `This statement was added in MySQL 5.1.7 but was found to be dangerous and was removed in MySQL 5.1.23` source: http://web.archive.org/web/20160504181056/https://dev.mysql.com/doc/refman/5.1/en/rename-database.html – Shadow Jun 27 '20 at 18:36
  • Yes, I'm aware of that, but MySQL 5.1 is out of support and the manual is not online anymore. You had to fetch it from the internet archive to see that page. The chances that a person currently developing a MySQL app would be using version 5.1 are slim. – Bill Karwin Jun 27 '20 at 18:41
  • guys please help me and suggest me what should i do..??? – ATUL TIWARI Jun 28 '20 at 07:51

0 Answers0