Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-05-2017, 01:05 PM   #1
Cyber Fucker
Hmm
 
Cyber Fucker's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
Comparing/Diff-ing MySQL Tables

What are the best tools to do it? I need this badly.

A few days ago some very bad shit happened to my mysql databases. Fortunately I had backups and only 1 day was lost. However, I realized that having something to do diff on tables would be very helpful. I can compare raw dumps using text editors and comparison tools but that's not a really cool way to do it. I would be very grateful for any tips and suggestions.
__________________
Cyber Fucker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-05-2017, 01:16 PM   #2
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
you don't need any "tool", just run a query using the 2 tables...
most straight forward way is probably to "LEFT JOIN" on id fields on the 2 tables and then search for "table2.id IS NULL" that will find any missing rows...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-05-2017, 06:02 PM   #3
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
run mysqldump with "--skip-opt" to get the 2 dumps files i.e:

Code:
mysqldump --skip-opt -u $MY_USER -p$MY_PASS mydb1 > /tmp/dump1.sql

mysqldump --skip-opt -u $MY_USER -p$MY_PASS mydb2 > /tmp/dump2.sql
compare using these diff options:

Code:
diff -y --suppress-common-lines /tmp/dump1 /tmp/dump2
diff - How do I see the differences between 2 MySQL dumps? - Stack Overflow

Interesting thread you would have to try and see ...

see: $ man diff
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
mysql, tables, tools, text, raw, dumps, compare, editors, diff, helpful, tips, suggestions, helpme, grateful, cool, comparison, day, days, ago, bad, badly, shit, happened, comparing/diff-ing, lost



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.