Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ae723ce5
Commit
ae723ce5
authored
Apr 28, 2009
by
Matthias Leich
Browse files
Options
Browse Files
Download
Plain Diff
Merge latest changes into local GCA tree
no conflicts
parents
386ceb49
7f119d20
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
30 deletions
+30
-30
scripts/mysqlhotcopy.sh
scripts/mysqlhotcopy.sh
+30
-30
No files found.
scripts/mysqlhotcopy.sh
View file @
ae723ce5
...
...
@@ -49,11 +49,11 @@ $0 Ver $VERSION
Usage:
$0
db_name[./table_regex/] [new_db_name | directory]
-?, --help display this helpscreen and exit
-?, --help display this help
-
screen and exit
-u, --user=# user for database login if not current user
-p, --password=# password to use when connecting to server (if not set
in my.cnf, which is recommended)
-h, --host=#
H
ostname for local server when connecting over TCP/IP
-h, --host=#
h
ostname for local server when connecting over TCP/IP
-P, --port=# port to use when connecting to local server with TCP/IP
-S, --socket=# socket to use when connecting to local server
...
...
@@ -86,7 +86,7 @@ sub usage {
# Do not initialize user or password options; that way, any user/password
# options specified in option files will be used. If no values are specified
# all, the defaults will be used (login name, no password).
# a
t a
ll, the defaults will be used (login name, no password).
my %opt
=
(
noindices
=>
0,
...
...
@@ -95,7 +95,7 @@ my %opt = (
method
=>
"cp"
,
flushlog
=>
0,
)
;
Getopt::Long::Configure
(
qw
(
no_ignore_case
))
;
# disamb
u
guate -p and -P
Getopt::Long::Configure
(
qw
(
no_ignore_case
))
;
# disamb
i
guate -p and -P
GetOptions
(
\%
opt,
"help"
,
"host|h=s"
,
...
...
@@ -453,7 +453,7 @@ else {
printf
"Locked
$num_tables
tables in %d seconds.
\n
"
, time-
$start
unless
$opt
{
quiet
}
;
$hc_started
=
time
;
# count from time lock is granted
# flush tables to make on-disk copy up
to
date
# flush tables to make on-disk copy up
to
date
$start
=
time
;
$dbh
->do
(
"FLUSH TABLES /*!32323
$hc_tables
*/"
)
;
printf
"Flushed tables (
$hc_tables
) in %d seconds.
\n
"
, time-
$start
unless
$opt
{
quiet
}
;
...
...
@@ -895,7 +895,7 @@ tables and you don't want to have all the tables locked for the
whole duration.
In this situation, I<
if
>
you are happy
for
groups
of tables to be
backed up separately
(
and thus possibly not be logically consist
a
nt
backed up separately
(
and thus possibly not be logically consist
e
nt
with one another
)
then
you can run mysqlhotcopy several
times
on
the same database each with different db_name./table_regex/.
All but the first should use the
--addtodest
option so the tables
...
...
@@ -920,7 +920,7 @@ server in a mutual replication setup.
=
item
--regexp
pattern
Copy all databases with names matching the pattern
Copy all databases with names matching the pattern
.
=
item
--regexp
/pattern1/./pattern2/
...
...
@@ -933,7 +933,7 @@ names begin with 'bar' from all databases which names end with 'foo':
=
item db_name./pattern/
Copy only tables matching pattern. Shell metacharacters
(
(
,
)
, |,
!
,
etc.
)
have to be escaped
(
e.g.
\)
.
For example, to
select
all tables
etc.
)
have to be escaped
(
e.g.
,
\)
.
For example, to
select
all tables
in
database db1 whose names begin with
'foo'
or
'bar'
:
mysqlhotcopy
--indices
--method
=
cp
db1./^
\(
foo
\|
bar
\)
/
...
...
@@ -947,19 +947,19 @@ that do not begin with foo nor bar:
=
item -?,
--help
Display help
screen and
exit
Display help
-screen and exit.
=
item
-u
,
--user
=
#
user
for
database login
if
not current user
User
for
database login
if
not current user.
=
item
-p
,
--password
=
#
p
assword to use when connecting to the server. Note that you are strongly
P
assword to use when connecting to the server. Note that you are strongly
encouraged
*
not
*
to use this option as every user would be able to see the
password
in
the process list. Instead use the
'[mysqlhotcopy]'
section
in
one of the config files, normally /etc/my.cnf or your personal ~/.my.cnf.
(
See the chapter
'my.cnf Option Files'
in
the manual
)
(
See the chapter
'my.cnf Option Files'
in
the manual
.
)
=
item
-h
,
-h
,
--host
=
#
...
...
@@ -968,12 +968,12 @@ different from 'localhost' will trigger mysqlhotcopy to use TCP/IP connection.
=
item
-P
,
--port
=
#
p
ort to use when connecting to MySQL server with TCP/IP. This is only used
P
ort to use when connecting to MySQL server with TCP/IP. This is only used
when using the
--host
option.
=
item
-S
,
--socket
=
#
UNIX domain socket to use when connecting to
local
server
UNIX domain socket to use when connecting to
local
server
.
=
item
--noindices
...
...
@@ -983,7 +983,7 @@ on the backup.
=
item
--method
=
#
m
ethod
for
copy
(
only
"cp"
currently supported
)
.
Alpha support
for
M
ethod
for
copy
(
only
"cp"
currently supported
)
.
Alpha support
for
"scp"
was added
in
November 2000. Your experience with the scp method
will vary with your ability to understand how scp works.
'man scp'
and
'man ssh'
are your friends.
...
...
@@ -1000,15 +1000,15 @@ scp or rsync the files at your leisure.
=
item
-q
,
--quiet
be silent except
for
errors
Be silent except
for
errors.
=
item
--debug
Debug messages are displayed
Debug messages are displayed
.
=
item
-n
,
--dryrun
Display commands without actually doing them
Display commands without actually doing them
.
=
back
...
...
@@ -1030,18 +1030,18 @@ to be specified on the command line:
mysqlhotcopy db newdb t1 t2 /^foo_/ : t3 /^bar_/ : +
where
":"
delimits the subsets, the /^foo_/ indicates all tables
with names begining with
"foo_"
and the
"+"
indicates all tables
with names begin
n
ing with
"foo_"
and the
"+"
indicates all tables
not copied by the previous subsets.
newdb is either another not existing database or a full path to a directory
where we can create a directory
'db'
'newdb'
is either the name of the new database, or the full path name
of the new database file. The database should not already exist.
Add option to lock each table
in
turn
for
people
who
don
\'
t need
cross-table integrity.
Add option to FLUSH STATUS just before UNLOCK TABLES.
Add support
for
other copy methods
(
e
g
tar
to single file?
)
.
Add support
for
other copy methods
(
e
.g.,
tar
to single file?
)
.
Add support
for
forthcoming MySQL
``
RAID
''
table subdirectory layouts.
...
...
@@ -1049,26 +1049,26 @@ Add support for forthcoming MySQL ``RAID'' table subdirectory layouts.
Tim Bunce
Martin Waite -
added checkpoint, flushlog, regexp and dryrun options
Martin Waite -
Added checkpoint, flushlog, regexp and dryrun options.
Fixed cleanup of targets when hotcopy fails.
Added
--record_log_pos
.
RAID tables are now copied
(
don
't know if this works over scp).
Ralph Corderoy -
added synonyms for commands
Ralph Corderoy -
Added synonyms for commands.
Scott Wiersdorf -
added table regex and scp support
Scott Wiersdorf -
Added table regex and scp support.
Monty -
working --noindex (copy only first 2048 bytes of index file)
Fixes for --method=scp
Monty -
Working --noindex (copy only first 2048 bytes of index file).
Fixes for --method=scp
.
Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again.
Emil S. Hansen - Added resetslave and resetmaster.
Jeremy D. Zawodny - Removed depr
i
cated DBI calls. Fixed bug which
Jeremy D. Zawodny - Removed depr
e
cated DBI calls. Fixed bug which
resulted in nothing being copied when a regexp was specified but no
database name(s).
Martin Waite - Fix to handle database name that contains space.
Paul DuBois - Remove end '
/
' from directory names
Paul DuBois - Remove end '
/
' from directory names
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment