当我使用命令行运行SQL脚本从MySQL数据库中导出数据时,出现了上述错误。
当在phpMyAdmin中运行SQL查询时,一切正常,但是在命令行中运行就会出错。
这里是我使用的命令行:
这里是我使用的命令行:
cat my_export | mysql -uxyzuser -pabcpassword mydb > export072911.txt
my_export
中的代码如下:
SELECT CONCAT( custfirstname, ' ', custlastname ) AS fullname, custcompany, \
SPACE( 10 ) AS custtitle, custaddressone, custaddresstwo, custcity, custstate, \
custzip, SPACE( 10 ) AS dummy, custphone, SPACE( 10 ) AS custfax, custemail, \
event_id, SPACE( 10 ) AS ticket1, SPACE( 10 ) AS ticket2, \
SPACE( 10 ) AS ticket3, SPACE( 10 ) AS ticket4, orderdate, b.quantity, \
FROM order_master a \
LEFT JOIN order_detail b ON b.order_master_id = a.id \
LEFT JOIN customer c ON c.email = a.custemail \
WHERE a.orderdate > '2010-12-01'\
AND a.event_id = '30' \
AND a.orderstatus = 'O' \
AND b.litype = 'ITEM' \
AND b.reftag = 'PKG' \
ORDER BY a.orderdate DESC;