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
|
--- sql/load_db.sh.old 2004-02-24 13:43:37.000000000 +0900
+++ sql/load_db.sh 2005-11-05 05:42:59.000000000 +0900
@@ -5,23 +5,26 @@
# Name of the database for docsys to use
DATABASE="eidetic"
# Name of the mysql user that will access the database
-USER="user"
+USER="eidetic"
# default host the mysql user will access the database from
HOST="localhost"
# password for the mysql user
-PASSWORD="pass"
+PASSWORD=""
# Drop the docsys database if it exists
-mysql -NBe 'SHOW DATABASES' | grep "$DATABASE" >/dev/null && mysqladmin drop "$DATABASE"
-mysqladmin create "$DATABASE"
+mysql -NBe -u root -p 'SHOW DATABASES' | grep "$DATABASE" >/dev/null && mysqladmin drop "$DATABASE"
+mysqladmin -u root -p create "$DATABASE"
# Create user for eidetic database
echo "GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX
ON ${DATABASE}.*
TO ${USER}@${HOST}
IDENTIFIED BY '${PASSWORD}';
- FLUSH PRIVILEGES;" | mysql
+ FLUSH PRIVILEGES;" | mysql -u root -p
# Build the default contents of the docsys database
-cat *.sql | mysql -u "$USER" --password="$PASSWORD" "$DATABASE" && echo Database populated
-
+for files in *.sql
+do
+ echo "Executing ${files}"
+ mysql -u "$USER" --password="$PASSWORD" "$DATABASE" < ${files} && echo Database populated
+done
--- sql/create_table_permission.sql.old 2005-11-05 05:43:28.000000000 +0900
+++ sql/create_table_permission.sql 2005-11-05 05:43:36.000000000 +0900
@@ -3,7 +3,7 @@
user_uid INT UNSIGNED,
resource_tag TEXT,
access ENUM ("Y", "N") DEFAULT "N",
- trust_score TINYINT DEFAULT 0, # 0-100%
+ trust_score TINYINT DEFAULT 0
);
|