Create alias
alias db='mysql -hlocalhost -uroot -p123456'
Create the execution file of the mysql statement: mysql.txt
select * from test_db.test_table
Enter
$ db < /path/to/mysql.txt | cat > store.log## in the Linux command line #The final data in store.log is the result of select * from db.table. So useful!Recommended: "
mysql video tutorial"
The above is the detailed content of Teach you to print data directly from MySQL to a file. For more information, please follow other related articles on the PHP Chinese website!