We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c751ab commit b587476Copy full SHA for b587476
func/db.sh
@@ -47,7 +47,10 @@ mysql_connect() {
47
}
48
49
mysql_query() {
50
- mysql --defaults-file=$mycnf -e "$1" 2>/dev/null
+ sql_tmp=$(mktemp)
51
+ echo "$1" > $sql_tmp
52
+ mysql --defaults-file=$mycnf < "$sql_tmp" 2>/dev/null
53
+ rm -f "$sql_tmp"
54
55
56
mysql_dump() {
@@ -89,7 +92,10 @@ psql_connect() {
89
92
90
93
91
94
psql_query() {
- psql -h $HOST -U $USER -c "$1" 2>/dev/null
95
96
97
+ psql -h $HOST -U $USER -f "$sql_tmp" 2>/dev/null
98
+ rm -f $sql_tmp
99
100
101
psql_dump() {
0 commit comments