MySQL provides DESCRIBE statement for this purpose. Take an example, first we will create a table then get it described:
mysql> CREATE TABLE tbl_name
-> (
-> id INT NOT NULL,
-> first_name CHAR(30) NOT NULL,
-> last_name CHAR(30) NOT NULL,
-> UNIQUE (id),
-> INDEX (last_name, first_name)
-> );
Query OK, 0 rows affected (0.42 sec)
mysql> DESCRIBE tbl_name;
+------------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+----------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| first_name | char(30) | NO | | NULL | |
| last_name | char(30) | NO | MUL | NULL | |
+------------+----------+------+-----+---------+-------+
3 rows in set (0.00 sec)