Mini SQL 2.0

Beta 1

Standard Programs and Utilities



The monitor - msql

Usage msql [-h host] [-f confFile] database
Options
-h Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance)
-f Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf)
Description The mSQL monitor is an interactive interface to the mSQL server. It allows you to submit SQL commands directly to the server. Any valid mSQL syntax can be entered at the prompt provided by the mSQL monitor.

Control of the monitor itself is provided by 4 internal commands. Each command is comprised of a backslash followed by a single character. The available command are
\q Quit
\g Go (Send the query to the server)
\e Edit (Edit the previous query)
\p Print (Print the query buffer)



Schema viewer - relshow

Usage relshow [-h host] [-f confFile] [database [rel [idx] ] ]
Options
-h Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance)
-f Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf)
Description Relshow is used to display the structure of the contents of mSQL databases. If no arguments are given, relshow will list the names of the databases currently defined. If a database name is given it will list the tables defined in that database. If a table name is also given then it will display the structure of the table (i.e. field names, types, lengths etc).

If an index name is provided along with the database and table names, relshow will display the structure of the specified index including the type of index and the fields that comprise the index.



Admin program - msqladmin

Usage msqladmin [-h host] [-f confFile] [-q] Command
Options
-h Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance)
-f Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf)
-q Put msqladmin into quiet mode. If this flag is specified, msqladmin will not prompt the user to verify dangerous actions (such as dropping a database).
Description msqladmin is used to perform administrative operations on an mSQL database server. Such tasks include the creation of databases, performing server shutdowns etc. The available commands for msqladmin are

create db_name Creates a new database called db_name
drop db_name Removes the database called db_name from the server. This will also delete all data contained in the database!
shutdown Terminates the mSQL server.
reload Forces the server to reload ACL information.
version Displays version and configuration information about the currently running server.
stats Displays server statistics.

Note : most administrative functions can only be executed by the user specified in the run-time configuration as the admin user. They can also only be executed from the host on which the server process is running (e.g. you cannot shutdown a remote server process).



Data dumper - msqldump

Usage msqldump [-h host] [-f confFile] [-c] [-v] database [table]
Options
-h Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance)
-f Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf)
-c Include column names in INSERT commands generated by the dump.
-v Run in verbose mode. This will display details such as connection results etc.
Description msqldump produces a an ASCII text file containing valid SQL commands that will recreate the table or database dumped when piped through the mSQL monitor program. The output will include all CREATE TABLE commands required to recreate the table structures, CREATE INDEX commands to recreate the indices, and INSERT commands to populate the tables with the data currently contained in the tables.

Note : msqldump does not recreate sequences at this time.



Data exporter - msqlexport

Usage msqlexport [-h host] [-f conf] [-v] [-s Char] [-q Char] [-e Char] database table
Options
-h Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance)
-f Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf)
-v Verbose mode
-s Use the character Char as the separation character. The default is a comma.
-q Quote each value with the specified character
-e Use the specifed Char as the escape character. The default is \
Description msqlexport produces an ASCII export of the data from the specified table. The output produced can be used as input to other programs such as spreadsheets. It has been designed to be as flexible as possible allowing the user to specify the character to use to separate the fields, the character to use to escape the separator character if it appears in the data, and whether the data should be quoted and if so what character to use as the quote character.

The output is sent to stdout with one data row per line.



Data importer - msqlimport

Usage msqlimport [-h host] [-f conf] [-v] [-s Char] [-e Char] [-c col,col...] database table
Options
-h Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance)
-f Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf)
-v Verbose mode
-s Use the character Char as the separation character. The default is a comma.
-e Use the specifed Char as the escape character. The default is \
-c A comma separated list of column names into which the data will be inserted.
Note : there can be no spaces in the list.
Description msqlimport loads a flat ASCII data file into an mSQL database table. The file can be formatted using any character as the column separator. When passed through msqlimport, each line of the txt file will be loaded as a row in the database table. The separation character as specified by the -s flag, will be used to split the line of text into columns. If the data uses a specific character to escape any occurence of the separation character in the data, the escape character can be specified with the -e flag and will be removed from the data before it is inserted.




Copyright © 1996 Hughes Technologies Pty Ltd.