--- title: ".sql file — what it is and how to open it" description: "A .sql file is a SQL Script. A text file of database commands — often a full database dump. How to open one on Windows, macOS and Linux, and what to convert it to." url: https://atoneplace.net/file/sql/ site: "At One Place" --- # .sql files **.sql file: SQL Script** A text file of database commands — often a full database dump. ## What opens a .sql file - **Windows:** DBeaver, Visual Studio Code, SQL Server Management Studio, Notepad (built in) - **macOS:** DBeaver, Visual Studio Code, TablePlus - **Linux:** DBeaver, Visual Studio Code, psql / mysql (command line) ## What a .sql file is A .sql file holds SQL statements, usually either a schema definition or an entire database export produced by mysqldump or pg_dump. It is plain text, so a small one opens in any editor, but a dump of a real database can be gigabytes and will hang a graphical editor. You run it against a database with the mysql or psql command line, phpMyAdmin, or a tool such as DBeaver. ## Converting it A .sql file is commonly converted to .csv, .txt or .db. It is a plain text format, so any text editor can open and edit it directly. ## Details - **Extension:** .sql - **Full name:** SQL Script - **Category:** Data - **MIME type:** application/sql - **Created by:** ISO/IEC 9075 (SQL standard) - **Format:** Plain text ## Common questions ### How do I open a .sql file? On Windows use DBeaver; on macOS use DBeaver; on Linux use DBeaver. A text file of database commands — often a full database dump. ### What is a .sql file? SQL Script. A .sql file holds SQL statements, usually either a schema definition or an entire database export produced by mysqldump or pg_dump. It is plain text, so a small one opens in any editor, but a dump of a real database can be gigabytes and will hang a graphical editor. ### Can I convert a .sql file? Yes. It is usually converted to .csv, .txt or .db, either by exporting from one of the programs listed above or with a format converter. ## Related pages - [.csv — Comma-Separated Values](https://atoneplace.net/file/csv/) - [.json — JavaScript Object Notation](https://atoneplace.net/file/json/) - [.xml — Extensible Markup Language](https://atoneplace.net/file/xml/) - [.yaml — YAML Data File](https://atoneplace.net/file/yaml/) - [.log — Log File](https://atoneplace.net/file/log/) - [.torrent — BitTorrent Metainfo File](https://atoneplace.net/file/torrent/) - [.dat — Generic Data File](https://atoneplace.net/file/dat/) - [.vcf — vCard Contact File](https://atoneplace.net/file/vcf/) - [.ics — iCalendar Event](https://atoneplace.net/file/ics/) - [.sqlite — SQLite Database](https://atoneplace.net/file/sqlite/) - [.db — Generic Database File](https://atoneplace.net/file/db/) - [.bin — Binary File](https://atoneplace.net/file/bin/) ## Sources - Media Types Registry — IANA (https://www.iana.org/assignments/media-types/) - Official vendor product documentation — At One Place (/about/)