Skip to content

MYSQL: Show the SQL for creating an existing table

Michael Watts edited this page May 8, 2019 · 1 revision

Running a query in SQL:

SHOW CREATE TABLE table_name

will output something like:

CREATE TABLE `table_name` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `zone` varchar(100) NOT NULL,
  `uprn` bigint(20) NOT NULL,
  `full_address` varchar(255) NOT NULL,
  `postcode` varchar(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_postcode` (`postcode`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=128281 DEFAULT CHARSET=utf8

SSH

2 Best practices when logging in remotely to linux machine

WARGAMES

Clone this wiki locally