0

I have got the .sql file as result of backing up my whole website data. I have the SQL file with me now. All I want is to view the data as tables. The file is quite big and weighs 700 mb. I have MySQL software with me. When I try to open the file, it first ask whether to open or just run, saying it is quite big file to handle. Selecting run make the software immediately stuck and eventually report problem and close.

If I select open, after long time it open up showing many sentences of codes with insert, and all. If I choose to run the SQL from there, it again get stuck. So, it too become impossible to view the table. Is there any alternative way to view the SQL file as a table? Using any software or any online ways, to view the table.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Nirmal Scaria
  • 21
  • 1
  • 3
  • 1
    See [How to import an SQL file using the command line in MySQL?](http://stackoverflow.com/questions/17666249/how-to-import-an-sql-file-using-the-command-line-in-mysql) – Alex K. Jun 09 '16 at 15:26
  • [MySQL Workbench](https://www.mysql.com/products/workbench/) is an easy way to restore `.sql` dump files. – tadman Jun 09 '16 at 15:27
  • 1
    A .sql file is text that contains SQL statements. There is no *table* to view until those SQL statements are executed in order to create the tables. – Ken White Jun 09 '16 at 15:28
  • All these are true. The problem here is the size. Can please say how to deal with the big file? – Nirmal Scaria Jun 09 '16 at 15:30
  • What are the specs of the computer you are trying to run the SQL file on? From past experience running an entire generated file like that takes lots of RAM. You could try running the statement in pieces, for example all of the create statements and then run the inserts for one table at a time. – Zoldren Jun 09 '16 at 15:37
  • Its just average. 4 gb ram. i3 and all. – Nirmal Scaria Jun 09 '16 at 15:48
  • Apparently Windows [has a `more` command](http://superuser.com/a/426229) - that should do it! – halfer Jun 09 '16 at 20:33

1 Answers1

-1

I suggest you import your dump into a local database, then you will be able to navigate it and run queries against it.

dhinchliff
  • 1,106
  • 8
  • 17
  • Can you please explain? Sorry, im completely new to sql . – Nirmal Scaria Jun 09 '16 at 15:26
  • 1
    This is too vague for an answer. It's at best a comment to the original question (which you don't yet have privileges to post). It needs to either be improved by adding some additional information and detail or it needs to be deleted as not being an answer. – Ken White Jun 09 '16 at 15:29
  • Because what you want is a SQL client, and they will all work against a SQL server, not a dump file. – dhinchliff Jun 09 '16 at 15:30