1

I'm using HeidiSQL to access my remote MySQL db.

Recently I was sent an .sql file.

Is there a way to open this file using HeidiSQL? Does anyone know of a better way to graphically view and manipulate a local sql file?

I know that in windows Heidi associates with sql files but when double clicked nothing happens.

hitautodestruct
  • 113
  • 1
  • 4

2 Answers2

1

(This part lifted from my answer here...)

The first thing to note is that an .sql file is not a MySQL database. It is a script file containing SQL statements. You would run such a script against the database platform for which it was written (using the SQL dialect for a specific SQL database engine) to create the actual database.


From comments to other answer:

I was wondering if there is a way on Heidi or another program to do this without setting up a server.

No, you need a server somewhere. If there was any stand-alone tool that could "graphically manipulate" an .sql file (containing DDL, I presume) then it would have to have its own MySQL server embedded in it.

Gord Thompson
  • 1,277
  • 9
  • 13
0

You could of course just use any text editor such as Notepad to edit the SQL file and then paste the result in the Query screen indicated here: http://www.heidisql.com/screenshots.php?which=query

Make sure though that you use an ANSI text editor and that if you have any non standard characters, that they are pasted correctly.

RoKa
  • 1,624
  • 11
  • 16
  • Nice idea, but this is a pretty big file ~10Mb – hitautodestruct Apr 10 '13 at 12:31
  • I would assume that the file does a lot more than just one or two queries. Is there any reason you cannot use the normal mySQL tools? – RoKa Apr 10 '13 at 12:33
  • I could and probably will use phpMyAdmin but I was wondering if there is a way on Heidi or another program to do this without setting up a server. – hitautodestruct Apr 10 '13 at 12:35
  • Well, you would certainly not have to set up a server just to install the mySQL Workbench (would you?) --> http://dev.mysql.com/downloads/tools/workbench/ – RoKa Apr 10 '13 at 12:38
  • @hitautodestruct : I just downloaded this tool, and it looks like from the Tools menu, you can select Load SQL File. Have you tried that option yet? – RoKa Apr 10 '13 at 12:48
  • Just tried it but it still needs a connection to a db. – hitautodestruct Apr 10 '13 at 13:19
  • Another option is perhaps use a tool such as NotePad++ (plus plus)? From the Language menu you can set it to SQL. I have used it tonnes of times to manipulate SQL files without a server connection, but you will not have the added benefit of properly parsing it without a connection to a server. http://notepad-plus-plus.org/ – RoKa Apr 10 '13 at 13:30