gunasekharyalamuri
asked on
unexpected EOF Error In mysql
********************** Named as test.sh ************************** *
#!/bin/sh
mysql -uroot -e "USE Userdata;
SELECT 'Name', 'ID', 'Mobile',UNION
SELECT Name,Id,Mobile from Mobiledata INTO OUTFILE '/tmp/Test_REPORT-22-08-20 12.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"';"
exit 0
*******************
###############Error I am Getting While executing ##################
./test.sh: line 5: unexpected EOF while looking for matching `''
./test.sh: line 8: syntax error: unexpected end of file
#!/bin/sh
mysql -uroot -e "USE Userdata;
SELECT 'Name', 'ID', 'Mobile',UNION
SELECT Name,Id,Mobile from Mobiledata INTO OUTFILE '/tmp/Test_REPORT-22-08-20
exit 0
*******************
###############Error I am Getting While executing ##################
./test.sh: line 5: unexpected EOF while looking for matching `''
./test.sh: line 8: syntax error: unexpected end of file
ASKER
Getting Same Error..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry Same Problem, Please tell me alternate..
I don't see any problem ... so I cannot tell a alternate at this point ...
also, you should use UNION ALL to avoid a implicit DISTINCT operation
finally, the ENCLOSED BY looks bad, your single quotes are mislocated indeed.
Open in new window