1
|
#!/bin/bash -e
|
2
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/runscripts/import.run
|
3
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/runscripts/subdir.run
|
4
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/sh/resume_import.sh
|
5
|
|
6
|
if self_not_included; then
|
7
|
|
8
|
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
|
import()
|
29
|
{
|
30
|
echo_func
|
31
|
top_make
|
32
|
}
|
33
|
|
34
|
fi
|