.TH MYSQLFS 1
.SH NAME
mysqlfs \- MySQL database client
.SH SYNOPSIS
.B mysqlfs
[
.B -a
] [
.B -b
] [
.B -k
.I param=value ...
] [
.B -m
]
.I mntpt
[
.B -s
]
.I srvname
[
.B -v
]
.I host ...
.sp 0.7v
.nf
.B /mnt/db/processes
.B /mnt/db/databases
.B /mnt/db/clone
.BI /mnt/db/ n
.BI /mnt/db/ n /ctl
.BI /mnt/db/ n /query
.BI /mnt/db/ n /data
.fi
.PP
.B Mysqlfs
generates a two level synthetic file hierarchy which allows client programs
to share a single connection to a MySQL database.
.PP
.I Databases
contains a list of the databases available on the server,
one per line. In common with other tabular files generated by
.I mysqlfs
each read of
.I databases
file returns a single row.
.I Processes
returns a one line header followed by a table of database
server process information, one line per process.
.PP
When the
.I clone,
file is opened a new session is allocated, the file contains
the text of the session index; and the file
descriptor becomes that of the
.I ctl
file in the session directory.
Session directories are named by their session index
as a decimal number.
.PP
SQL statements may be written to the
.I query
file and results tables (if any) subsequently read back from
.IR data .
Errors returned by the SQL server will result in
write errors on the query file.
.PP
The following control messages may be written to the
.I ctl
file provide context for queries or modify the formatting of replies.
.TP
.B use database
.br
Select the database to use for queries on this session.
A
.B use
command must be written to the
.I ctl
file before any queries may be submitted.
.TP
.B headings
.br
Prepend all results read from the
.I data
file with the column headings.
.TP
.B noheadings
.br
Disable column headings.
.TP
.B padded
.br
Results columns are padded with whitespace to ensure
they align correctly.
.TP
.B delimited
.br
Results columns are not padded but are delimited with
an unlikely character.
.TP
.B colsep ch
.br
Set the column separator to
.IR cb ,
the default is the pipe symbol (|).
.TP
.B rowsep ch
Set the row seperator to
.IR ch ,
the default is a newline character (\\n).
.SH EXAMPLE
.EX
.SM
.SM
mysqlfs -m /n/phonebook phoneserver
{
d=/n/phonebook/`{cat}
echo headings > $d/ctl
echo use phonesearch > $d/ctl
echo SELECT name, num FROM tel WHERE name LIKE ''''%^$1^%'''' > $d/query
cat $d/data
} < /n/phonebook/clone
.EE
.SH FILES
/sys/src/cmd/mysqlfs/*
.SH BUGS
The MySQL protocol used in servers before V4.1 is not supported, though
fall-back authentication for servers holding pre V4.1 passwords is provided.
.PP
As MySQL scramble authentication uses challange-response it should be pushed
into factotum to ensure the users passwords can never leak.
|