Get the MySQL database schema using SQL August 24, 2024
Antre du Tryphon

Get the MySQL database schema using SQL

August 24, 2024 · Admin MySQL Database

A complete database schema can be retrieved using the following MySQL statement from the information_schema database:

SELECT * FROM SCHEMATA LEFT JOIN tables ON table_schema = schema_name LEFT JOIN columns ON tables.table_name = columns.table_name WHERE schema_name = '<DATABASE_NAME>';

Copyright 2012–2026, Claude "Tryphon" Théroux