Hi Bytes.. i have need to assign Mysql Database DataField value to shell script variable .
is it possible ? i have tried like this .. got error..
Got Output like this..
test.sh: command substitution: line 1: syntax error near unexpected token `from'
test.sh: command substitution: line 1: `select mem from profile'
ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'd =" "' at line 1
is it possible ? i have tried like this .. got error..
Code:
#!bin/sh password=xxx mysql -u root -p$password -h 192.168.1.8 << y use dbssys; d ="`select mem from profile` "; echo $d quit y
test.sh: command substitution: line 1: syntax error near unexpected token `from'
test.sh: command substitution: line 1: `select mem from profile'
ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'd =" "' at line 1
Comment