klickreflex
klickreflex

Reputation: 181

Browse a SQL-Dump file without importing it into a DBMS?

Is somebody aware of a tool that lets me browse MySQL-Files without having to import them into my database system? I'm looking for an easy way to inspect MySQL Backups quickly without having to import them - but still being nicely displayed, so viewing the SQL source is not really an option.

Maybe there's a program that takes the SQL dump and automatically imports it into a temporary database, then presenting it in an interface similar to HeidiSQL (or any other SQL-Gui-Tool).

Upvotes: 6

Views: 6101

Answers (2)

texas-bronius
texas-bronius

Reputation: 31

I came here looking for an answer to the same question, because it can be cumbersome to wait to load a 20 GB sql dump just for inspection and drop again. While I hope to find a standalone shortcut tool, best I can recommend is a cocktail of linux cli text manipulation tools like grep, sed, and cut. Some useful output could be:

  • What tables are being created/inserted into?
  • Are the mysqldump INSERTs one line-per-record or all stuffed into one? (Because this can affect other things like)
  • How many rows are being inserted into table XYZ?
  • What is some representative data being inserted into table XYZ?
  • What is the ABC column value for the last row inserted into table XYZ?

Good luck!

Upvotes: 1

Keith Randall
Keith Randall

Reputation: 23265

Why are you eliminating the obvious solution? You just need to load the backup into a mysql database. Either load the backup into a separate mysql instance, or if your backup is of just one database (i.e. you didn't pass --databases or --all-databases to mysqldump), load it into a database of a different name.

Upvotes: 1

Related Questions