Hi Bytes, in Linux , is it possible to redirect Mysql table output to a file in Linux.
i tried it, shows error , but output has displayed in linux prompt when no redirection of file has given(say select * from tablename) but when i am trying redirect output to file in Linux it shows error? can you tell me suggestion for this issue.
code i used :
<code>
#!bin/sh
password=xyzbac
mysql -u root -p$password -h 192.168.1.8 << y
use sys;
select memory from sysprofile >> newf1
quit
y
</code>
got error:
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 '>> newf1
quit' at line 1
i tried it, shows error , but output has displayed in linux prompt when no redirection of file has given(say select * from tablename) but when i am trying redirect output to file in Linux it shows error? can you tell me suggestion for this issue.
code i used :
<code>
#!bin/sh
password=xyzbac
mysql -u root -p$password -h 192.168.1.8 << y
use sys;
select memory from sysprofile >> newf1
quit
y
</code>
got error:
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 '>> newf1
quit' at line 1
Comment