Handy hint: Debugging your database web application

I'm working on someone else's web application and I can't work out where a particular bug is because the previous developer was sloppy. The code is written half and English and half in Spanish which means the next developer needs to be bi-lingual and, on top of that, the English part is full of spelling errors so the table names in the database are wrong.

Here's how to work out what tables have been updated:

Export the database to a file with mysqldump:

mysqldump dbname > tempfile1.txt

Query your website then do it again to another file

mysqldump dbname > tempfile.txt

Compare with diff

diff tempfile1.txt tempfile2.txt

This should output the lines that have been updated in your database dump.


Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options