GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Difference between MySQL databases (https://gfy.com/showthread.php?t=968300)

camperjohn64 05-13-2010 11:39 AM

Difference between MySQL databases
 
Does anyone have ideas on how to do a difference between databases?

For example, I have 50 tables in a database on some software that I bought. I want to take a snapshot of the database, upload a photo, edit a gallery, then take another snapshot of the database to see what changed.

Any ideas on how I can do that?

> mysql databaseB - databaseA

I am thinking to do a dump of the database, make a new DB, then source it. Make my changes on the site...

But then how do I do a "difference of everything in all tables" dump?

GrouchyAdmin 05-13-2010 11:43 AM

So just do two dumps or setup a master-slave relationship with binlogs and setup query logging on the slave; when done just drop the slave association/etc.

fatfoo 05-13-2010 11:56 AM

Good luck.

AdultSoftwareSolutions 05-13-2010 11:59 AM

The last post says how you would do it. But what are you ultimately trying to do? Reverse engineer? Have 2 versions of a site with an admin on one and not the live server?

Brujah 05-13-2010 12:06 PM

show table status; -- should tell you which tables have changed, and then you can look in the table.. if that's not enough you could...

mysql -e 'select * from table' > before.txt
.. do your stuff here ..
mysql -e 'select * from table' > after.txt

then; diff before.txt after.txt

BestXXXPorn 05-13-2010 12:11 PM

Quote:

Originally Posted by Brujah (Post 17136181)
show table status; -- should tell you which tables have changed, and then you can look in the table.. if that's not enough you could...

mysql -e 'select * from table' > before.txt
.. do your stuff here ..
mysql -e 'select * from table' > after.txt

then; diff before.txt after.txt

That's how I'd do it...

LoveSandra 05-13-2010 12:18 PM

bump 4 answers

drocd 05-13-2010 12:34 PM

Why not just enable the query log and see what queries were executed?
- http://dev.mysql.com/doc/refman/5.1/en/query-log.html

camperjohn64 05-13-2010 02:04 PM

Quote:

Originally Posted by drocd (Post 17136272)
Why not just enable the query log and see what queries were executed?
- http://dev.mysql.com/doc/refman/5.1/en/query-log.html

Awesome!

Yes, I am trying to reverse engineer a table. I have software to populate with data, and don't want to manually do it. So I'm hoping I can write a little php script that populates data automatically.


All times are GMT -7. The time now is 10:42 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123