mysql 存储过程写入文件
方法1:
shell> mysql -uroot -proot -h localhost xxx库 -e " select * from xxx表 limit 1" >> out.txt
方法2:
#>echo “select * from xxx表 limit 1” | /usr/local/mysql/bin/mysql -h 127.0.0.1 -uroot -proot xxx库 > /home/out.txt
方法3:
mysql>select * from xxx表 INTO OUTFILE ‘./xxx.txt’;
效果如图