MySQL system metadata location: In which built-in MySQL database are system tables and metadata (for example, user accounts and privileges) stored by default?

Difficulty: Easy

Correct Answer: In the MySQL database mysql

Explanation:


Introduction / Context:
MySQL ships with several internal schemas used for administration and instrumentation. Knowing where metadata lives helps DBAs perform tasks such as privilege management, server configuration, and diagnostics using SQL queries.



Given Data / Assumptions:

  • You are using standard MySQL server distributions.
  • System tables for users, privileges, and other core metadata exist.
  • We must identify the canonical schema name that contains these objects.


Concept / Approach:

The built-in schema named mysql stores core system tables (for example, user, db, tables_priv in historical versions). Additional schemas like information_schema and performance_schema provide metadata views and performance instrumentation, but privilege and configuration tables historically reside in the mysql database itself, which is the answer closest to the options provided.



Step-by-Step Solution:

List built-in schemas: mysql, information_schema, performance_schema, sys (helper views).Identify where core system tables are: mysql schema.Choose “In the MySQL database mysql”.


Verification / Alternative check:

Run SHOW DATABASES; and DESCRIBE mysql.user; on a MySQL instance to verify the presence of system tables in the mysql schema.



Why Other Options Are Wrong:

“metadata” and “metasql” are not standard built-in schema names.

“None of the above” is incorrect because mysql is the correct built-in schema.



Common Pitfalls:

Confusing information_schema (read-only views of metadata) with the underlying mysql system tables; assuming system tables are absent in managed cloud offerings (they may be restricted but still exist).



Final Answer:

In the MySQL database mysql

More Questions from JDBC, Java Server Pages, and MySQL

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion