6

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).

bobs
  • 21,844
  • 12
  • 67
  • 78
klickreflex
  • 181
  • 2
  • 9

2 Answers2

1

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.

Keith Randall
  • 22,985
  • 2
  • 35
  • 54
  • Especially if you don't load all the data into the database, this would be as good as any other solution. You'll need to scan the full dump anyhow. – Konerak Oct 18 '10 at 18:58
  • Yes the most common thing to do is importing/loading it into a temporary newly created schema. But sometimes, we only need to see some tiny part of it's contents; which I usually achieve by opening it with notepad. A tiny utility which present the table contents in more tidy format will be nice. This utility may ignore everything else. – Daniel Wu Mar 23 '22 at 05:52
1

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!

  • One more thought: Just stumbled across this interesting tool https://github.com/thirtysixthspan/hasten which appears to at least speed up the load by disabling indexing at the right time ¯\_(ツ)_/¯ – texas-bronius May 09 '18 at 21:18