Home > Database > Mysql Tutorial > 直接从MySQL中将数据打印到文件中的方法

直接从MySQL中将数据打印到文件中的方法

PHPz
Release: 2020-02-27 13:24:41
forward
1580 people have browsed it

 

直接从MySQL中将数据打印到文件中的方法

推荐《mysql教程

创建alias

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

创建mysql语句的执行文件: mysql.txt

select * from test_db.test_table
Copy after login

在Linux命令行中输入

$ db < /path/to/mysql.txt | cat > store.log
Copy after login

最终store.log中的数据即是select * from db.table的结果。

太好用了!

更多编程相关内容,请关注php中文网编程入门栏目!

 

Related labels:
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template