Home > Database > Mysql Tutorial > body text

Teach you to print data directly from MySQL to a file

藏色散人
Release: 2020-04-01 08:55:16
forward
2381 people have browsed it

Teach you to print data directly from MySQL to a file

Create alias

alias db='mysql -hlocalhost -uroot -p123456'
Copy after login

Create the execution file of the mysql statement: mysql.txt

select * from test_db.test_table
Copy after login

Enter

$ db < /path/to/mysql.txt | cat > store.log
Copy after login
## 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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template