Godaddy web hosting - Working with MySQL SQL 52 SHOW COLUMNS Once

Working with MySQL SQL 52 SHOW COLUMNS Once you create a table, you can obtain information about its columns, how they are defined, and primary key information by using SHOW COLUMNS. The full format of the command is SHOW [FULL] COLUMNS FROM

[FROM ] [LIKE ] If you use the basic format, SHOW COLUMNS FROM
, you see the following: mysql> show columns from acc; +———-+—————+——+—–+———+——-+ | Field | Type | NULL | Key | Default | Extra | +———-+—————+——+—–+———+——-+ | acc_id | int(11) | | PRI | 0 | | | username | varchar(64) | YES | | NULL | | | password | varchar(64) | YES | | NULL | | | ts | timestamp(14) | YES | | NULL | | +———-+—————+——+—–+———+——-+ 4 rows in set (0.00 sec) MySQL provides a shortcut to the basic format by using the DESCRIBE
command. The command assumes you have USEd a database. By using the [FULL] option, you display the privileges the current logged-on user has with the table columns as well. SHOW STATUS You can obtain a great deal more information about a table by using the SHOW STATUS command. The format of the command is SHOW TABLE STATUS [FROM ] [LIKE ] For example: mysql> show table status; This command works on all tables from the current database or from a specified database. If you want to limit the tables the command accesses, use the LIKE option. SHOW PROCESSLIST The last command we cover in our introduction section is SHOW PROCESSLIST. This command is useful for determining access to the database server both current access and access in the recent past. The format of the command is SHOW [FULL] PROCESSLIST

Hint: This post is supported by Gama web hosting php services

Comments are closed.