MYSQLFS(1) MYSQLFS(1)
NAME
mysqlfs - MySQL database client
SYNOPSIS
mysqlfs [ -a ] [ -b ] [ -k param=value ... ] [ -m ] mntpt [
-s ] srvname [ -v ] host ...
9 /mnt/db/processes
/mnt/db/databases
/mnt/db/clone
/mnt/db/n
/mnt/db/n/ctl
/mnt/db/n/query
/mnt/db/n/data
Mysqlfs generates a two level synthetic file hierarchy which
allows client programs to share a single connection to a
MySQL database.
Databases contains a list of the databases available on the
server, one per line. In common with other tabular files
generated by mysqlfs each read of databases file returns a
single row. Processes returns a one line header followed by
a table of database server process information, one line per
process.
When the 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 ctl file in the session
directory. Session directories are named by their session
index as a decimal number.
SQL statements may be written to the query file and results
tables (if any) subsequently read back from
data.Errorsreturnedbythe write errors on the query file.
The following control messages may be written to the ctl
file provide context for queries or modify the formatting of
replies.
use database
Select the database to use for queries on this session.
A use command must be written to the ctl file before
any queries may be submitted.
headings
Prepend all results read from the data file with the
column headings.
noheadings
Disable column headings.
9 Page 1 Plan 9 (printed 9/3/10)
MYSQLFS(1) MYSQLFS(1)
padded
Results columns are padded with whitespace to ensure
they align correctly.
delimited
Results columns are not padded but are delimited with
an unlikely character.
colsep ch
Set the column separator to cb, the default is the pipe
symbol (|).
rowsep ch
Set the row seperator to ch, the default is a newline
character (\n).
EXAMPLE
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
FILES
/sys/src/cmd/mysqlfs/*
BUGS
The MySQL protocol used in servers before V4.1 is not sup-
ported, though fall-back authentication for servers holding
pre V4.1 passwords is provided.
As MySQL scramble authentication uses challange-response it
should be pushed into factotum to ensure the users passwords
can never leak.
Page 2 Plan 9 (printed 9/3/10)