How to change database name in sql without deleting the database | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to change database name in sql without deleting the database

9th Feb 2017, 9:48 AM
pruthvi raju
pruthvi raju - avatar
2 Answers
0
in t-sql ALTER DATABASE dbname MODIFY NAME = newdbname
12th Feb 2017, 5:49 PM
Luke T
Luke T - avatar
0
I'm afraid that is not possible. You can use "mysqldump" to dump the data and then create a schema with your new name and then dump the data into that new database. See: https://dev.mysql.com/doc/refman/5.7/en/mysqldump-sql-format.html
9th Feb 2017, 12:35 PM
Henrik Liljenfeldt
Henrik Liljenfeldt - avatar