如何在MYSQL中查看所有的表名?或者一个表下的字段,刚接触,不懂

解决方案 »

  1.   

    mysql> use test;
    Database changed
    mysql> show tables;
    +-------------------------+
    | Tables_in_test          |
    +-------------------------+
    | arc                     |
    | book                    |
    | char_test               |
    ...
    +-------------------------+
    24 rows in set (0.16 sec)mysql> show columns from arc;
    +-------+---------+------+-----+---------+----------------+
    | Field | Type    | Null | Key | Default | Extra          |
    +-------+---------+------+-----+---------+----------------+
    | Id    | int(11) | NO   | PRI | NULL    | auto_increment |
    | name  | int(11) | NO   |     | 0       |                |
    +-------+---------+------+-----+---------+----------------+
    2 rows in set (0.04 sec)
      

  2.   


    SELECT
      `TABLES`.`TABLE_SCHEMA`, `TABLES`.`TABLE_NAME` 
    FROM
      `information_schema`.`TABLES`
    WHERE
      `TABLES`.`TABLE_TYPE` = 'base table';SELECT *
    FROM
      `information_schema`.`COLUMNS` where `TABLE_SCHEMA`='test' and `TABLE_NAME`='arc' order by `ORDINAL_POSITION`;
      

  3.   

    如何连接一个远程的mySQL呢?
      

  4.   

    http://dev.mysql.com/doc/refman/5.1/zh/tutorial.html
      

  5.   

    mysql>use databases;
    mysql>show tables;