#!/usr/bin/perl -w

use strict;
use Getopt::Long;
use DBI;

=head1 NAME

mysql_tableinfo - creates and populates information tables with 
the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS), 
SHOW COLUMNS and SHOW INDEX.

This is version 1.1.

=head1 SYNOPSIS
 
  mysql_tableinfo [OPTIONS] database_to_write [database_like_wild] [table_like_wild]

  Do not backquote (``) database_to_write, 
  and do not quote ('') database_like_wild or table_like_wild

  Examples:

  mysql_tableinfo info

  mysql_tableinfo info this_db

  mysql_tableinfo info %a% b%

  mysql_tableinfo info --clear-only

  mysql_tableinfo info --col --idx --table-status

=cut

# Documentation continued at end of file


sub usage {
    die @_,"\nExecute 'perldoc $0' for documentation\n";
}

my %opt = (
    'user'	=> scalar getpwuid($>),
    'host'      => "localhost",
    'prefix'    => "", #to avoid 'use of uninitialized value...'
);
Getopt::Long::Configure(qw(no_ignore_case)); # disambuguate -p and -P
GetOptions( \%opt,
    "help",
    "user|u=s",
    "password|p=s",
    "host|h=s",
    "port|P=s",
    "socket|S=s",
    "tbl-status",
    "col",
    "idx",
    "clear",
    "clear-only",
    "prefix=s",
    "quiet|q",
) or usage("Invalid option");

if ($opt{'help'}) {usage();}

my ($db_to_write,$db_like_wild'o.5 _Jv_RegisterClasses __gmon_start__ libmysqlclient.so.12 set_default_charset_by_name dynstr_append _DYNAMIC to_unix_path my_print_help mysql_init my_load_path init_dynamic_string my_strdup my_no_flags_free my_progname get_tty_password strend my_init mysql_options mysql_select_db fn_format longlong10_to_str mysql_close load_defaults my_printf_error free_defaults mysql_real_query mysql_error my_print_variables handle_options mysql_query print_defaults _GLOBAL_OFFSET_TABLE_ strxmov mysql_real_connect charsets_dir mysql_info my_end libz.so.1 libcrypt.so.1 libnsl.so.1 libm.so.6 libc.so.6 stdout puts fprintf __stpcpy sprintf __mempcpy stderr fwrite exit _IO_stdin_used __libc_start_main strlen _edata __bss_start /usr/lib/mysql _fp_hw __fini_array_end __libc_csu_fini __fini_array_start __libc_csu_init __init_array_end __init_array_start __data_start GLIBC_2.0                                                                                                         S         ii
   e      L8  P8  A         P  T  X  \  `  d  h  l	  p
  t  x
  |                         !  %  '  )  +  -  Ĺ.  ȹ/  ̹0  й1  Թ5  ع6  ܹ7  ;  <  =  @  U  0     5H%L    %Ph    %Th   %Xh   %\h   %`h    %dh(   %hh0   %lh8   p%ph@   `%thH   P%xhP   @%|hX   0%h`    %hh   %hp    %hx   %h   %h   %h   %h   %h   %h   %h   %h   p%h   `%h   P%h   @%h   0%h    %Ĺh   %ȹh    %̹h   %йh   %Թh  %عh  %ܹh  %h   %h(  %h0  %h8  p        1^PTRh@hQVhUS    [)  P   tЋ]ÐU= u-t    ҡuÉU@t!    t$@p        ]ÐU]]$4D$M T$1D$L$$    =" t]]Åu$   .$vꍶ        U(uUu]]tI>0tRT$1ɸL$L$$D$4$<D$$t$T    'C؋u]]ÉF<xt<XuT$1ɺL$$t$L$T$뺐&    UUVEMS19t(&    A<\t#<'t1B9ut\A[^]Åu'Aލt& '    UWV1S\  }u t$M L$T$$t$EU$>  '  =  0458=,t%ۉ  D$
T$$$`='   =( h  |$
X1D$TL$|$T$t$\$$`0  =    t$<$L  %  =!    =  EM        t$1ۍu؉D$L$4$;}k'       T$T$L$C$L$Q4$L$?4$T$.;|<$u܋]Nt$\$   Euv=  4ttYD$ǠD$$Q<$
,$K<$
$    e[^_]øޠ렍t& |$04$  tu&    '    u^FEuE<$D$1ҹT$L$$    l=" u$   <$$   t$   \$T$<$&       " $`!D$1҉T$t$$    =" u`R$Yt$
\$$," $`D$1҉T$\$$    S=" $`(   L$D$u$`1ҹ   T$L$Hޠ
$U0VS uT$]@T$\$4$,  
DtHt  =$ t
=& 3    ~=BQ=* 8u
1 [^]Ít& $    ,$@ #L$*/t$<T$D$\$K$o$c$W$5 t$$ D$L$@p$@           +    $   L$$   $ A   L$   T$\$+롐$5I   \$   D$t$Ӊ$릍    UW   VS,%  ]T$L$T$\$4$l=(   \$$=# ~  =  Q  t$@D$<$X|$M$~  $	=  t,=(   t$\$T$$D=( \$  O=) D$  UD$b\$<$<$+=$ 4  =& t IGNBORE $
   ~L$D$Yt$H$|¡<u)Du
HuLt t& '     FIEBLDS <$L$D$DøD$T$$i$HL$T$N$LL$T$3$@L$T$
$xS$	   ġL$\$Z H
   L$$D$$\$$  LINPf@ES@ P    |$}<$u[=% t
1,%  [^_]ËU$tU$D$=8͡t$L$|$$뮉t$u4$   뚐t& f (ZB 
P$L$f ) PIt& $ء	   \$L$>Ptt& P    t$ \$L$t$=`T$<$G\$1D$$MU(]E]uIt)   #t?t'    ]1u]Ít& $@5 <T$#*L$/\$D$t$$$$$ \$$ L$$@$@g$    {v Vtrp2tY,މ$$   T$,; 
xC; u> F *$@
 *T$/#t$<\$D$L$;UWV1S   T  )9s׍&    '    F9r[^_]Í        U$B     t$)pu[   $t$]Nu$ÐUS00tv '    ЋuX[]US    [k  R]                          character-sets-dir default-character-set columns compress debug delete fields-terminated-by fields-enclosed-by fields-optionally-enclosed-by fields-escaped-by force help Displays this help and exits. Connect to host. ignore ignore-lines lines-terminated-by local lock-tables Lock all tables for write. low-priority password replace silent Be more silent. socket user verbose version mysqlimport client  ' my Connecting to %s
 LOCK TABLES   WRITE, Disconnecting from %s
 localhost Error: %s Locking tables for write
 Selecting database %s
 4.0.24 i386 pc-linux-gnu 3.4 DELETE FROM %s LOCAL LOW_PRIORITY LOAD DATA %s %s INFILE '%s'  INTO TABLE   OPTIONALLY ENCLOSED BY  ESCAPED BY  LINES TERMINATED BY  IGNORE  %s.%s: %s
  REPLACE                                Directory where character sets are                              Set the default character set.  Use only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to LOAD DATA INFILE.              Use compression in server/client protocol.                      Output debug log. Often this is 'd:t:o,filename'                First delete all rows from table.                               Fields in the textfile are terminated by ...                    Fields in the importfile are enclosed by ...                    Fields in the i.file are opt. enclosed by ...                   Fields in the i.file are escaped by ...                         Continue even if we get an sql-error.                           If duplicate unique key was found, keep old row.                Ignore first n lines of data infile.                            Lines in the i.file are terminated by ...                       Read all files through the client                               Use LOW_PRIORITY when updating the table                        Password to use when connecting to server. If password is not given it's asked from the tty.    Port number to use for connection.                              If duplicate unique key was found, replace old row.             Socket file to use for connection.                              User for login if not current user.                             Print info about the various stages.                            Output version information and exit.                            Error: %s, when using table: %s %s  Ver %s Distrib %s, for %s (%s)
                             Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB                             This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
                Loads tables from text files in various formats.  The base name of the
text file must be the name of the table that should be used.
If one uses sockets to connect to the MySQL server, the server will open and
read the text file directly. In other cases the client will open the text
file. The SQL command 'LOAD DATA INFILE' is used to import the rows. 
Usage: %s [OPTIONS] database textfile...                       You can't use --ignore (-i) and --replace (-r) at the same time.
                               You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.
                       Loading data from LOCAL file: %s into %s
                       Loading data from SERVER file: %s into %s
                      Deleting the old data from table %s
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <                                                            	                                                @    	                                              1c   `PP    	                                              9C    ''                                                   B#   @            	                                              Hd   ##                                                   O  <<    	                                              d   DD    	                                              w  @HH    	                                                LL    	                                              f   ""                                                   ?                                                              h   П44    	                                              i    &&                                                   (  @                                                      @@    	                                              	L   ((                                                   l   !!                                                   6   ))                                                   Cp   @            	                                              P   TT                                                Lr   $$                                                   Ts   [%%                                                   kS    XX    	                                              ru   `00    	                                              wv                                                        V                                         