mysql> select * from table1 where field1='tgtfield' into outfile 'dataOut.txt';
'dataOut.txt' 預設放在 MySQL data 目錄下,
i.e. /var/lib/mysql/databasename/
[ref]
http://www.learn-mysql-tutorial.com/ExportImport.cfm
2009年1月4日 星期日
如何將mysql table export 到xml file?
[Q] 如何將mysql table export 到xml file?
[try]
0. 在啟動 mysql client 需要enable --xml 選項
./mysql -ujon test --xml -e 'SELECT * FROM t1' > t1.xml
1. use php to fetch data and format the output
[ref]
http://dev.mysql.com/doc/refman/5.1/en/mysql-command-options.html#option_mysql_xml
http://forums.mysql.com/read.php?44,59164,161365#msg-161365
[try]
0. 在啟動 mysql client 需要enable --xml 選項
./mysql -ujon test --xml -e 'SELECT * FROM t1' > t1.xml
1. use php to fetch data and format the output
[ref]
http://dev.mysql.com/doc/refman/5.1/en/mysql-command-options.html#option_mysql_xml
http://forums.mysql.com/read.php?44,59164,161365#msg-161365
如何在 mysql client 內 執行linux shell 命令?
[Q] 如何在 mysql client 內 執行linux shell 命令?
[Q] How to execute shell commands from within the MySQL command line client?
[sol] mysql> \! ls -l
[ref]
http://www.electrictoolbox.com/shell-commands-mysql-command-line-client/
[Q] How to execute shell commands from within the MySQL command line client?
[sol] mysql> \! ls -l
[ref]
http://www.electrictoolbox.com/shell-commands-mysql-command-line-client/
訂閱:
文章 (Atom)