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
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!