I am new to MySQL. I am trying to get table definitions from the database server (4.0.26).

I tried below steps to get information, running cmd as an administrator:

c:\> cd mysql\bin\
c:\mysql\bin>mysql -u username -p
password: password

mysql>show database

    -> (nothing comes up)

After closing and opening, same steps till password:

mysql>use database
Database changed

mysql>show tables

     -> (nothing comes up)

I need to check two table definitions. What am I missing?

closed as off-topic by Jack Douglas Dec 31 '13 at 9:01

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    This question appears to be off-topic because it is too basic for the site. – Jack Douglas Dec 31 '13 at 9:01
  • 1
    Something basic are helpful solve big issues – sairam Dec 31 '13 at 13:29

you need to add semicolon at the end of your command.

     show databases;

     show tables;
  • you are welcome. please accept it so that folks around would know there is a correct answer for your question. ;) – lyonsun Dec 31 '13 at 8:52

In Addition to @Lyon's Answer , I have explained with example

mysql> show databases;
| Database           |
| information_schema |
| AbdulTest          |
| ClientDemo1        |
| mysql              |
| performance_schema |
| world              |
14 rows in set (0.00 sec)

mysql> use world;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> show tables;
| Tables_in_world |
| test            |
| test_reg        |
2 rows in set (0.00 sec)

If you need to look table definition "CREATE STATEMENT" of table do like

*************************** 1. row ***************************
       Table: test
Create Table: CREATE TABLE `test` (
  `col1` varchar(20) DEFAULT NULL,
  `col2` varchar(20) DEFAULT NULL
1 row in set (0.00 sec)

For basic MySQL Syntax please have a look at Link .

Not the answer you're looking for? Browse other questions tagged or ask your own question.