Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the MySQL equivalent of a PostgreSQL 'schema'?

I have a PostgreSQL database whose tables are divided amongst a number of schemas. Each schema has a different set of access controls; for example, one schema might be read-only to regular users, while they are allowed to create tables on another. Schemas also act as namespaces, so users don't have to worry about duplicating existing tables when they create new ones.

I want to create a similar setup using MySQL. Does it have an equivalent concept? If not, how can I most closely simulate it? I would prefer not to use multiple databases.

like image 391
DNS Avatar asked Dec 18 '09 01:12

DNS


People also ask

What is a MySQL 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 a Postgres schema?

In PostgreSQL, schema is a named collection of tables, views, functions, constraints, indexes, sequences etc. PostgreSQL supports having multiple schemas in a single database there by letting you namespace different features into different schemas.

Is MySQL similar to PostgreSQL?

PostgreSQL is an object-relational database, while MySQL is purely relational. This means PostgreSQL offers more complex data types and allows objects to inherit properties, but it also makes working with PostgreSQL more complex.

Which database is similar to PostgreSQL?

MySQL is an open-source relational database management system (RDBMS). Just like PostgreSQL, and all other relational databases for that matter, MySQL uses tables as a core component and has more or less the same feature set as PostgreSQL. Newer versions of MySQL (5.7+) even support some noSQL features.


2 Answers

Database should be the closest one.

like image 51
Milen A. Radev Avatar answered Sep 24 '22 07:09

Milen A. Radev


Prefixing table names is what's done with most MySQL-driven apps.

like image 39
moo Avatar answered Sep 26 '22 07:09

moo