Linux command
mdb-sql 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start interactive SQL session
mdb-sql [database.mdb]
Execute SQL from stdin
echo "SELECT * FROM [table_name]" | mdb-sql [database.mdb]
Pretty print output
mdb-sql -p [database.mdb]
Execute SQL from a file
mdb-sql -i [query.sql] [database.mdb]
Specify column delimiter
mdb-sql -d [,] -H [database.mdb]
Write output to file
mdb-sql -o [output.csv] [database.mdb]
说明
mdb-sql provides an SQL interface to Microsoft Access databases. It can run interactively or process SQL from stdin or files. SQL batches are terminated with the go command in interactive mode. The tool is part of the mdbtools suite. It supports SELECT queries against MDB/ACCDB files.
参数
- -H, --no-header
- Suppress column header row.
- -F, --no-footer
- Suppress footer row.
- -p, --no-pretty-print
- Tab-separated output instead of ASCII table format.
- -d, --delimiter _DELIM_
- Use alternative column delimiter.
- -i, --input _FILE_
- Read SQL from input file.
- -o, --output _FILE_
- Write results to output file.
- --version
- Print mdbtools version and exit.
FAQ
What is the mdb-sql command used for?
mdb-sql provides an SQL interface to Microsoft Access databases. It can run interactively or process SQL from stdin or files. SQL batches are terminated with the go command in interactive mode. The tool is part of the mdbtools suite. It supports SELECT queries against MDB/ACCDB files.
How do I run a basic mdb-sql example?
Run `mdb-sql [database.mdb]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -H, --no-header do in mdb-sql?
Suppress column header row.