I need to delete my schema when i created during table creation but i no need to disturb tables inside that schema so please suggest me to delete my schema without deleting tables present inside that schema.
Asked
Active
Viewed 567 times
0
-
first of all do you know what is exactly schema? – uvais Mar 04 '14 at 11:24
-
can you explain why you want to delete the schema. in mysql, a schema is pretty much a database - see [this](http://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_schema) for example. – wwkudu Mar 04 '14 at 11:28
-
schema which is used to hold multiple object @uvais – subramani Mar 04 '14 at 11:33
-
schema is only the structure , it can be structure of table or can be structure of database ok. you need to use databse instead of schema – uvais Mar 04 '14 at 11:35
-
and if you delete database all the tables related to this database will be delete – uvais Mar 04 '14 at 11:36
-
cleared right now thank you @ uvais – subramani Mar 04 '14 at 11:41
-
could u tell me exactly whether schema is for database structure or table structure ...i got confused – subramani Mar 04 '14 at 11:52
2 Answers
0
In Mysql a schema is the same as a database. Removing the schema removes the database, and also your objects (ie tables)

Mikpa
- 1,912
- 15
- 20
-
Mysql have no RENAME SCHEMA or DATABASE, look at this guide http://stackoverflow.com/questions/67093/how-do-i-quickly-rename-a-mysql-database-change-schema-name – Mikpa Mar 04 '14 at 11:40
-
yes thank you you are correct, could you give me the exact solution for my problem – subramani Mar 04 '14 at 11:47
-
-
it seems that we need to use for each table too complex is there any alternate solution? – subramani Mar 04 '14 at 11:55
-
Why do you need to rename? If you have a small db, dump it with mysqldump, drop db, create new, import dump – Mikpa Mar 04 '14 at 20:22
0
you can not delete schema without deleting underlying tables, because schema is logical container which holds database objects like table, procedure etc..
you want to do like: breaking the glass(filled with water) without flowing water, which is impossible,
best practice for your problem would be RENAME
your schema. so it feels like schema is no longer available, but you can access it via different name.
-
RENAME will not work kindly see notification from http://dev.mysql.com/doc/refman/5.1/en/rename-database.html – subramani Mar 04 '14 at 11:46