Hi,
the first is what "pan64" has given you the link
the second I'm adding is
here
so you need to "use database" and "show tables" afterwards.
Here's the "one-line" code for showing databases:
Code:
#!/bin/sh
echo "show databases;" | /usr/bin/mysql -u root -p"password"
The output:
Database
information_schema
horde
mysql
postfix
test
and here listing the tables in "mysql" database:
Code:
echo "use mysql; show tables;" | /usr/bin/mysql -u root -p"password"
Output:
Tables_in_mysql
columns_priv
db
func
help_category
help_keyword
help_relation
help_topic
host
proc
procs_priv
tables_priv
time_zone
time_zone_leap_second
time_zone_name
time_zone_transition
time_zone_transition_type
user