pmsql and pmysql let you talk to a running msql or mysql daemon sending either SQL queries or relshow (mysqlshow) commands.
The output is formatted much in the same way as by the msql or mysql monitor (see below),
the msqlexport command and the relshow (mysqlshow) program,
which are coming with msql or mysql.
The additional capability is a connection to a readline interface (if available) and a pipe to your favorite pager.
Additionally you may switch between hosts and databases within one session and you don't have to type the nasty \g or ; (a trailing \g,
\q,
and \p will be ignored).

If a command starts with one of the following reserved words,
it's treated specially,
otherwise it is passed on verbatim to the mSQL or mysql daemon.
Output from the daemon is piped to your pager specified by either the PMSQL_PAGER (PMYSQL_PAGER) or the PAGER environment variable.
If both are undefined,
the PATH is searched for either "less" or "more" and the first program found is taken.
If no pager can be determined,
or your pager variable contains the word stdout,
the program writes to unfiltered STDOUT.

Set the output format of SELECT commands,
default is on.
A value of off will create output suitable for export to other database systems.
The non-fancy output format is configurable with the commands escape,
quote and separator,
the default is well suited for import into Microsoft Ecxel.

Describe databases or tables in the same way as done by the relshow (mysqlshow) program.
If host or database are specified,
the defaults are set to these values.
The prameter index is only supported for mSQL-2.0.

pmsql and pmysql come with some basic completion definitions that are far from being perfect.
Completion means,
you can use the TAB character to run some lookup routines on the current host or database and use the results to save a few keystrokes.

The completion mechanism is very basic,
and I'm not intending to refine it in the near future.
Feel free to implement your own refinements and let me know,
if you have something better than what we have here.

pmsql and pmysql are not an msql and mysql clones.
If you use it as such for bulk uploads into the database,
you will notice an enourmous disadvantage in performance.
The reason is that pmsql and pmysql intentionally disconnect from the database after every query.

You need a readline package installed to get the advantage of a readline interface.
If you don't have it,
you won't be able to use the arrow keys in a meaningful manner.
Term::ReadKey and Term::ReadLine do not come with the perl distribution but are available from CPAN (see http://www.perl.com/CPAN).