SHOW CREATE TABLE
As a programmer, there are no real problems but challenges...ones that we need to overcome. This means that there is a solution for all challenges that one may face. For all the challenges that I have faced, I will share them and their solutions.
Tuesday, July 15, 2014
Show create table sql command
Run this command to show the create table sql command:
SHOW CREATE TABLE;
SHOW CREATE TABLE
Get size of database
You can get the size of a specific database by running this command:
SELECT table_schema "Data Base Name",
SUM( data_length + index_length ) / 1024 /
1024 "Data Base Size in MB",
SUM( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
WHERE table_schema = "";
If you want to show the size of all databases on a server, then use this command:
SELECT table_schema "Data Base Name",
SUM( data_length + index_length ) / 1024 /
1024 "Data Base Size in MB",
SUM( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema ;
SELECT table_schema "Data Base Name",
SUM( data_length + index_length ) / 1024 /
1024 "Data Base Size in MB",
SUM( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
WHERE table_schema = "
If you want to show the size of all databases on a server, then use this command:
SELECT table_schema "Data Base Name",
SUM( data_length + index_length ) / 1024 /
1024 "Data Base Size in MB",
SUM( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema ;
Subscribe to:
Posts (Atom)