File: msqldump.1

package info (click to toggle)
msql 2.0.3-5
  • links: PTS
  • area: non-free
  • in suites: hamm, slink
  • size: 3,596 kB
  • ctags: 2,483
  • sloc: ansic: 34,769; sh: 1,309; yacc: 1,084; perl: 328; makefile: 267
file content (148 lines) | stat: -rw-r--r-- 4,374 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
.\" msqldump - Mini SQL Database Dumper
.\" Copyright (c) 1995  Martin Schulze <joey@office.individual.net>
.\" 
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\" 
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\" 
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc.,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"
.\" This manual page is written especially for Debian GNU/Linux.
.\"
.TH MSQLDUMP 1 "22 Jul 1996" "Mini SQL" "Commands"
.SH NAME
msqldump \- Mini SQL Database Dumper
.SH SYNOPSIS
.B msqldump
.RB [ " \-c " ]
.RB [ " \-d " ]
.RB [ " \-h \fIhost\fP " ]
.RB [ " \-i \fIoffs\fP " [ " \fIlen\fP " ]]
.RB [ " \-r \fIoffs\fP " [ " \fIlen\fP " ]]
.RB [ " \-t " ]
.RB [ " \-v " ]
.RB [ " \-w \fIwhere\fP " ]
.RB [ " \-y " ]
.RI [ " database " [ " table " ]]

.SH DESCRIPTION
The
.B msqldump
command dumps a whole mSQL database in a way it can be easily
re-inserted.  The mSQL database might run on a different host.  Each
table of a database is separated in single INSERT statements.

Using
this command you have an easy way to make nightly backups of your
databases.  All you have to do to insert a dump is to pipe it
through
.BR msql (1).

Such a dump consists of two parts: table creation information and data
insertion information.  Both of them may be suppressed, see options.

.SH OPTIONS
The
.B msqldump
command understands the following options:

.TP
.B "\-c"
Produces complete INSERT statements including all field names.
.TP
.B "\-d"
Suppress data insertion information.
.TP
.BI "\-h " host
Specifies a different
.I host
than localhost.  See
.BR libmsql (3)
for Details in specifying a
.IR host name.
.TP
.BI "\-i " "offs len"
Inserts
.I len
fields before the field with the number
.IR offs .
Numbering begins at 1, any number greater than the number of fields
is equivalent to appending.
The default value for new fields is NULL and dummy names are
created.  You have to edit the dump by hand before piping it through
.BR msql (1).
.TP
.BI "\-r " "offs len"
Removes
.I len
fields beginning with the field with the number
.IR offs .
.TP
.B "\-t"
Suppress table creation information.
.TP
.B "\-v"
Be verbose, i.e. write additional information to stderr.
.TP
.BI "\-w " where
When dumping the database use this
.I where
clause to select fields.
.TP
.B "\-y"
Use '' instead NULL when inserting new fields in the table structure
.PP

Inserts and removes are only possible if both a database and a table
are specified on commandline.  To make these changes visible to the
engine you have to drop the table, re-create and re-fill it again.
This only works if you are dumping one single table of a database.

.B Warning:
Better not combine inserts and removes.  They don't work together.  Or
even better, re-write the code. :-)

.SH ENVIRONMENT
The mSQL family may be controlled by some environment variables.  They
override compiled-in default values but may be overridden by
commandline arguments.

.TP
.I MSQL_TCP_PORT
Specifies the TCP port on which the database engine listen to
requests.
.TP
.I MSQL_UNIX_PORT
Specifies the unix domain socket that shall be used to contact the
engine if it runs on the local host.
.TP
.I MINERVA_DEBUG
Specify debuging.  See
.BR msqld (8)
for possible values.

.SH AUTHOR
Mini SQL has been written by David Hughes of Bond University,
Australia as part of the Minerva Network Management
Environment.  He may be reached via electronic mail using
bambi@Bond.edu.au.

Original version of this program is written by Igor Romanenko
(igor@frog.kiev.ua) under the name of msqlsave.c and placed in the
public domain.  This program remains in the public domain to continue
the spirit of its original author although the modifications made to
the original program are.

Martin Schulze (joey@infodrom.north.de) has implemented inserts and removes.
.SH "SEE ALSO"
.BR msql (1),
.BR libmsql (3),
.BR msqld (8).