Rumah >pangkalan data >tutorial mysql >直接从MySQL中将数据打印到文件中的方法
推荐《mysql教程》
创建alias
alias db='mysql -hlocalhost -uroot -p123456'
创建mysql语句的执行文件: mysql.txt
select * from test_db.test_table
在Linux命令行中输入
$ db < /path/to/mysql.txt | cat > store.log
最终store.log
中的数据即是select * from db.table
的结果。
太好用了!
更多编程相关内容,请关注php中文网编程入门栏目!