Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
70773b12
Commit
70773b12
authored
8 years ago
by
Dan Staines
Browse files
Options
Downloads
Patches
Plain Diff
added separate target user/pass
parent
861ce71b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc-scripts/CopyDBoverServer.pl
+25
-10
25 additions, 10 deletions
misc-scripts/CopyDBoverServer.pl
with
25 additions
and
10 deletions
misc-scripts/CopyDBoverServer.pl
+
25
−
10
View file @
70773b12
...
...
@@ -72,12 +72,21 @@ Command line switches:
--pass=XXX (Required)
The password for the MySQL user to
connect to the database server.
connect to the
source
database server.
--user=XXX (Optional)
MySQL user to connect to the database server.
MySQL user to connect to the
source
database server.
Default will be 'ensadmin'.
--target_pass=XXX (Required)
The password for the MySQL user to
connect to the target database server.
If not specified, will be the same as --pass
--target_user=XXX (Optional)
MySQL user to connect to the target database server.
If not specified, will be the same as --user
--noflush (Optional)
Skips table flushing completely. Use very
sparsingly as copying un-flushed databases
...
...
@@ -227,7 +236,7 @@ Script restrictions:
LONG_USAGE_END
}
## end sub long_usage
my
(
$opt_password
,
$opt_user
,
$opt_only_tables
,
$opt_skip_tables
,
$opt_help
);
my
(
$opt_password
,
$opt_user
,
$opt_password_tgt
,
$opt_user_tgt
,
$opt_only_tables
,
$opt_skip_tables
,
$opt_help
);
my
$opt_flush
=
1
;
# Flush by default.
my
$opt_check
=
1
;
# Check tables by default.
...
...
@@ -240,8 +249,11 @@ my $opt_tmpdir;
my
$opt_routines
=
0
;
my
(
$opt_source
,
$opt_target
,
$opt_source_dir
,
$opt_target_dir
);
if
(
!
GetOptions
(
'
pass=s
'
=>
\
$opt_password
,
if
(
!
GetOptions
(
'
pass=s
'
=>
\
$opt_password
,
'
user=s
'
=>
\
$opt_user
,
'
target_pass=s
'
=>
\
$opt_password_tgt
,
'
target_user=s
'
=>
\
$opt_user_tgt
,
'
flush!
'
=>
\
$opt_flush
,
'
flushtarget!
'
=>
\
$opt_flushtarget
,
'
check!
'
=>
\
$opt_check
,
...
...
@@ -303,6 +315,9 @@ if (!defined($opt_user))
$opt_user
=
'
ensadmin
';
}
$opt_user_tgt
||=
$opt_user
;
$opt_password_tgt
||=
$opt_password
;
my
$input_file
;
if
(
!
defined
(
$opt_source
)
)
{
...
...
@@ -519,8 +534,8 @@ foreach my $spec (@todo) {
$target_hostaddr
,
$target_port
);
my
$target_dbh
=
DBI
->
connect
(
$target_dsn
,
$opt_user
,
$opt_password
,
{
$opt_user
_tgt
,
$opt_password
_tgt
,
{
'
PrintError
'
=>
1
,
'
AutoCommit
'
=>
0
}
);
...
...
@@ -1052,8 +1067,8 @@ TABLE:
if
(
$opt_flushtarget
)
{
print
("
FLUSHING TABLES ON TARGET...
\n
");
my
$tdbh
=
DBI
->
connect
(
$target_dsn
,
$opt_user
,
$opt_password
,
{
$opt_user
_tgt
,
$opt_password
_tgt
,
{
'
PrintError
'
=>
1
,
'
AutoCommit
'
=>
0
}
);
...
...
@@ -1070,8 +1085,8 @@ TABLE:
if
(
$opt_routines
){
print
(
'
-
'
x
31
,
'
Procedures
',
'
-
'
x
31
,
"
\n
"
);
$target_dbh
=
DBI
->
connect
(
$target_dsn
,
$opt_user
,
$opt_password
,
{
$opt_user
_tgt
,
$opt_password
_tgt
,
{
'
PrintError
'
=>
1
,
'
AutoCommit
'
=>
0
}
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment