[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"howto:sql:linux:en":3},{"resolvedFromAlias":4,"canonicalExt":5,"ext":5,"name":6,"category":7,"categoryName":8,"updatedAt":9,"os":10,"osLabel":11,"quickSolution":12,"stepByStep":13,"recommendedSoftware":17,"alternativeMethods":18,"commonIssues":19,"securityNote":38,"extensionPath":39,"extensionLabel":40,"breadcrumbs":41,"metaDescription":51},false,"sql","SQL script (Structured Query Language)","code","Code","2026-06-12T09:08:10.411Z","linux","Linux","To open .SQL files on Linux, to view/edit: open the file in a text editor (for example, a terminal editor) since .sql is plain text.",[14,15,16],"To view/edit: open the file in a text editor (for example, a terminal editor) since .sql is plain text.","To execute in PostgreSQL: run psql from a terminal and execute the script file (see the PostgreSQL psql documentation).","On Linux desktops, file type association can use the shared MIME-info database; the file is typically mapped by extension to a MIME type such as application/sql per freedesktop.org shared-mime-info.",[],[],[20,26,32],{"title":21,"description":22,"steps":23},"Double-clicking opens the file in the wrong program",".sql is plain text, so the OS may associate it with an unexpected editor or a database tool you don’t want to use for viewing.",[24,25],"Use “Open with” to choose your preferred text editor for reading/editing.","If you need to run it, open your database client (for example psql) and execute the script from there instead of double-clicking.",{"title":27,"description":28,"steps":29},"Script runs but fails with syntax errors","SQL syntax and supported features can vary between database systems, so a script generated for one product may not run unchanged on another.",[30,31],"Confirm which database the script targets (for example PostgreSQL vs MySQL) and run it using the matching client/tool (psql for PostgreSQL; MySQL CLI/Workbench for MySQL).","If you must run it on a different database, edit the SQL to match that database’s dialect and features, then try again.",{"title":33,"description":34,"steps":35},"Import/execute fails due to missing database connection or permissions","Executing a .sql file requires connecting to the right server/database and having privileges to create/alter objects or modify data.",[36,37],"Verify you are connecting to the intended database instance and database name in your client (for example in psql connection options).","Ask for or grant the required permissions before re-running the script.",".sql files can contain destructive statements (for example dropping tables or deleting data). Read the script in a text editor before executing it, especially if it came from an untrusted source.","/file-extension/sql",".SQL",[42,45,48],{"label":43,"to":44},"Home","/",{"label":46,"to":47},"How To","/file-extension",{"label":49,"to":50},"Open .SQL on Linux","/how-to/open-sql-on-linux","Learn how to open .SQL files on Linux with step-by-step instructions, recommended software, and troubleshooting tips."]