Skip to content
Snippets Groups Projects
Commit e1e2c164 authored by Demian Katz's avatar Demian Katz
Browse files

Merge pull request #226 from finc/master

modified build.xml to allow mysql root user without password
parents 57716665 53d439f4
No related merge requests found
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
<property name="pgsqlrootuser" value="postgres" /> <property name="pgsqlrootuser" value="postgres" />
<property name="version" value="2.3" /> <property name="version" value="2.3" />
<if><not><equals arg1="${mysqlrootpass}" arg2="" /></not><then>
<property name="mysqlrootpass" value="-p${mysqlrootpass}" />
</then></if>
<!-- Main Target --> <!-- Main Target -->
<target name="main" description="main target"> <target name="main" description="main target">
<phingcall target="startup" /> <phingcall target="startup" />
...@@ -136,11 +140,11 @@ ...@@ -136,11 +140,11 @@
</then> </then>
<else> <else>
<!-- build database --> <!-- build database -->
<exec command="mysqladmin -f -h ${mysqlhost} -u ${mysqlrootuser} -p${mysqlrootpass} drop ${vufinddb}" /> <exec command="mysqladmin -f -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlrootpass} drop ${vufinddb}" />
<exec command="mysqladmin -h ${mysqlhost} -u ${mysqlrootuser} -p${mysqlrootpass} create ${vufinddb}" checkreturn="true" /> <exec command="mysqladmin -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlrootpass} create ${vufinddb}" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} -p${mysqlrootpass} -e &quot;GRANT SELECT,INSERT,UPDATE,DELETE ON ${vufinddb}.* TO '${vufinddbuser}'@'${mysqlhost}' IDENTIFIED BY '${vufinddbpass}' WITH GRANT OPTION&quot;" checkreturn="true" /> <exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlrootpass} -e &quot;GRANT SELECT,INSERT,UPDATE,DELETE ON ${vufinddb}.* TO '${vufinddbuser}'@'${mysqlhost}' IDENTIFIED BY '${vufinddbpass}' WITH GRANT OPTION&quot;" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} -p${mysqlrootpass} -e &quot;FLUSH PRIVILEGES&quot;" checkreturn="true" /> <exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlrootpass} -e &quot;FLUSH PRIVILEGES&quot;" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} -p${mysqlrootpass} -D ${vufinddb} &lt; ${srcdir}/module/VuFind/sql/mysql.sql" checkreturn="true" /> <exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlrootpass} -D ${vufinddb} &lt; ${srcdir}/module/VuFind/sql/mysql.sql" checkreturn="true" />
<!-- configure VuFind --> <!-- configure VuFind -->
<exec command="sed -e &quot;s!mysql://root@localhost/vufind!mysql://${vufinddbuser}:${vufinddbpass}@${mysqlhost}/${vufinddb}!&quot; ${srcdir}/config/vufind/config.ini &gt; ${srcdir}/local/config/vufind/config.ini" /> <exec command="sed -e &quot;s!mysql://root@localhost/vufind!mysql://${vufinddbuser}:${vufinddbpass}@${mysqlhost}/${vufinddb}!&quot; ${srcdir}/config/vufind/config.ini &gt; ${srcdir}/local/config/vufind/config.ini" />
...@@ -186,7 +190,7 @@ ...@@ -186,7 +190,7 @@
<exec command="sudo su -c &quot;psql -c \&quot;DROP USER ${vufinddbuser};\&quot;&quot; ${pgsqlrootuser}" checkreturn="true" /> <exec command="sudo su -c &quot;psql -c \&quot;DROP USER ${vufinddbuser};\&quot;&quot; ${pgsqlrootuser}" checkreturn="true" />
</then> </then>
<else> <else>
<exec command="mysqladmin -f -h ${mysqlhost} -u ${mysqlrootuser} -p${mysqlrootpass} drop ${vufinddb}" /> <exec command="mysqladmin -f -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlrootpass} drop ${vufinddb}" />
</else> </else>
</if> </if>
...@@ -277,4 +281,4 @@ ...@@ -277,4 +281,4 @@
</if> </if>
</target> </target>
</project> </project>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment