1 |
8291
|
aaronmk
|
#!/bin/bash -e
|
2 |
8774
|
aaronmk
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/runscripts/import.run
|
3 |
9589
|
aaronmk
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/runscripts/subdir.run
|
4 |
|
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/sh/resume_import.sh
|
5 |
8285
|
aaronmk
|
|
6 |
8705
|
aaronmk
|
if self_not_included; then
|
7 |
|
|
|
8 |
9589
|
aaronmk
|
dumpfile_stem=GBIFPortalDB-2013-02-20
|
9 |
|
|
dumpfile_stem_path="$top_dir/$dumpfile_stem"
|
10 |
|
|
|
11 |
|
|
load_data() # usage: [database=GBIF_new] load_data
|
12 |
|
|
{
|
13 |
|
|
echo_func
|
14 |
|
|
|
15 |
|
|
use_local_remote
|
16 |
|
|
database= mysql_root <<EOF
|
17 |
|
|
CREATE DATABASE IF NOT EXISTS $database DEFAULT CHARACTER SET utf8/*utf8_general_ci*/;
|
18 |
|
|
GRANT ALL PRIVILEGES ON $database.* TO '$local_user'@'%' WITH GRANT OPTION;
|
19 |
|
|
REVOKE UPDATE, DELETE, ALTER, DROP ON $database.* FROM '$local_user'@'%';
|
20 |
|
|
EOF
|
21 |
|
|
|
22 |
|
|
sql_preamble <"$top_dir"/../_src/"$dumpfile_stem".dump >"$dumpfile_stem_path".schema.0.preamble.sql
|
23 |
|
|
cat "$dumpfile_stem_path".schema*.sql|mysql_root
|
24 |
|
|
time cat "$dumpfile_stem_path".data*.sql|mysql_rm_privileged_statements\
|
25 |
|
|
|log_queries= mysql_local
|
26 |
|
|
}
|
27 |
|
|
|
28 |
9074
|
aaronmk
|
import()
|
29 |
8285
|
aaronmk
|
{
|
30 |
8881
|
aaronmk
|
echo_func
|
31 |
9506
|
aaronmk
|
top_make
|
32 |
8285
|
aaronmk
|
}
|
33 |
8705
|
aaronmk
|
|
34 |
|
|
fi
|