`` <`character in exec task breaks my Phing script assembly

I am trying to configure a mysql script import in Phing, but "<" is causing XML errors. Any ideas?

<exec command="mysql -u${mysql.username} -p${mysql.password} -h ${mysql.server} ${mysql.database} < ${sql.file}" />

I'm trying to make dbDeploy this way, but it would be great if there was an easy way to do this (a single-line command compared to multi-line dbDeploy setup)

+3
source share
2 answers

Reset the character by replacing it with &lt;

+8
source

I am not familiar with Phing, but it cannot execute the command in the shell, so the redirection operator will not work (it can process the operator as an argument itself mysql).

< ${sql.file} -e 'source ${sql.file}', :

<exec command="mysql -u${mysql.username} -p${mysql.password} -h ${mysql.server} ${mysql.database} -e 'source ${sql.file}'" />

MySQL.

+3

Source: https://habr.com/ru/post/1718508/


All Articles