在mysql中,
show tables是将所有数据库下的表显示出来,其中有一些是系统表,我应该如何操作,才能够只显示我自己建立的表,谢谢高手回答

解决方案 »

  1.   

    select * from information_schema.tables 
    where table_schema='XXX' and table_type='base table'
      

  2.   


    mysql> select table_name from information_schema.tables where table_type='BASE TABLE';
      

  3.   

    table_schema='XXX' and table_type='base table',这两个地方应该写什么,
      

  4.   


    你不是要查询所有库下的用户表么?》只要使用where table_type='BASE TABLE' 这个限定条件就好了 
    'base table' 就是表示用户表 不用改 直接复制上去执行吧 
      

  5.   

     table_name
    ---------------------------
     t1
     columns_priv
     db
     event
     func
     general_log
     help_category
     help_keyword
     help_relation
     help_topic
     host
     ndb_binlog_index
     plugin
     proc
     procs_priv
     servers
     slow_log
     tables_priv
     time_zone
     time_zone_leap_second
     time_zone_name
     time_zone_transition
     time_zone_transition_type
     user
     a
     dsf
      

  6.   

    LZ明显是把表建在MYSQL 那个库里去了....
      

  7.   

    不是啊,是在usertest里面,我就想显示所有我自己建立的表,不显示系统自己带的
      

  8.   

    o ..这个 table_type 的base table 表示是基本表~
      

  9.   

    现在电脑中有information_schma,myfirst,mysql,test,usertest,有这几个数据库,我如何判定那些是我自己添加的,哪些是系统自带的?
      

  10.   

    information_schma,mysql,test是安装完之后默认自带的。
      

  11.   

    系统自带的只有
    mysql
    information_schema这两个。另外大部分情况下,系统还会自动创建一个test,但这个你可以删除
      

  12.   

    select table_name from information_schema.tables where table_type='BASE TABLE' and table_schema='YourDatabaseName';
    把YourDatabaseName换成你要查的数据库的名字,这样就会查出该数据库下所有的你建的表。