-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_mysql.xml
More file actions
71 lines (63 loc) · 2.28 KB
/
Copy pathdb_mysql.xml
File metadata and controls
71 lines (63 loc) · 2.28 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<project name="db_mysql">
<macrodef name="db_mysql_create_database">
<attribute name="host" />
<attribute name="port" />
<attribute name="user" />
<attribute name="password" default="" />
<attribute name="database" />
<sequential>
<local name="cmd" />
<property name="cmd" value="--default-character-set=utf8 --host=@{host} --port=@{port} --user=@{user} --password=@{password} create @{database}" />
<echo message="mysqladmin ${cmd}" />
<exec failonerror="true" executable="mysqladmin">
<arg line="${cmd}" />
</exec>
</sequential>
</macrodef>
<macrodef name="db_mysql_drop_database">
<attribute name="host" />
<attribute name="port" />
<attribute name="user" />
<attribute name="password" default="" />
<attribute name="database" />
<sequential>
<local name="cmd" />
<property name="cmd" value="--force --default-character-set=utf8 --host=@{host} --port=@{port} --user=@{user} --password=@{password} drop @{database}" />
<echo message="mysqladmin ${cmd}" />
<exec failonerror="true" executable="mysqladmin">
<arg line="${cmd}" />
</exec>
</sequential>
</macrodef>
<macrodef name="mysql">
<attribute name="host" />
<attribute name="port" />
<attribute name="user" />
<attribute name="password" default="" />
<attribute name="database" />
<attribute name="file" />
<sequential>
<local name="cmd" />
<property name="cmd" value="--default-character-set=utf8 --host=@{host} --port=@{port} --user=@{user} --password=@{password} @{database}" />
<echo message="mysql ${cmd}" />
<exec failonerror="true" executable="mysql" input="@{file}">
<arg line="${cmd}"/>
</exec>
</sequential>
</macrodef>
<macrodef name="mysql_commands">
<attribute name="host" />
<attribute name="port" />
<attribute name="user" />
<attribute name="password" default="" />
<attribute name="database" />
<element name="commands" />
<sequential>
<concat destfile="tmp/mysql_commands.sql" append="false">
<commands/>
</concat>
<mysql host="@{host}" port="@{port}" user="@{user}" password="@{password}" database="@{database}" file="tmp/mysql_commands.sql"/>
</sequential>
</macrodef>
</project>