Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySql: does it have namespace-like SCHEMA?

Tags:

sql

mysql

I have to move a database from sql server to mySql, and our current db uses schemas as namespace.

So all of the FOO tables can be reference like FOO.TableFoo1, FOO.TAbleFoo2, FOO.TableF003, etc.

Can we do this with MySql? Will it work.

like image 428
Hugo Estrada Avatar asked Feb 22 '10 15:02

Hugo Estrada


People also ask

Does MySQL have a schema?

The mysql schema is the system schema. It contains tables that store information required by the MySQL server as it runs. A broad categorization is that the mysql schema contains data dictionary tables that store database object metadata, and system tables used for other operational purposes.

What is namespace in MySQL?

In practice, these namespaces are merely a prefix before a given ID that is applied every time a value is stored or retrieve from the cache. You can implement the same basic principle by using keys that describe the object and the unique identifier within the key that you supply when the object is stored.

Does MySQL have schemas like SQL Server?

The MySQL concept of a schema maps to the SQL Server concept of a database and one of its schemas. For example, MySQL might have a schema named HR. An instance of SQL Server might have a database named HR, and within that database are schemas. One schema is the dbo (or database owner) schema.

Is schema the same as database MySQL?

In MySQL, schema is synonymous with database. As the query is written to create the database, similarly the query can be written to create the schema. Logical structure can be used by the schema to store data while memory component can be used by the database to store data.


1 Answers

That is wrong Joachim. A database is not a schema. Try buying hosting where you only get 20 databases but you need 33. With a schema you can use only one database and have many tables with the same name but different schema.

like image 161
art saliva Avatar answered Oct 10 '22 03:10

art saliva