I like Google. I use many of their products– GMail, Google Maps, Google Drive. Google Chrome has been my primary browser for years. I even own two Google Nexus devices because I wanted the “pure Android experience.”
But I also hate Google . . . because some people believe reading a single Google search result makes them a subject matter expert. This seems particularly true with web development topics. Imagine you have a large MySQL database, and you want to back that database up every week. There’s a tool for such a task called mysqldump, but you receive this cryptic error message when you use it:
mysqldump: Got error: 1016: Can’t open file: ‘./database_wp/wp2_154_
How will we make that backup now? I know, let’s Google Search that error message and find a solution!
Based on what we’ve found, all we need to do is add the lock-tables=false option to our mysqldump command. And if you do that, mysqldump will create an export without any error message. Voila! Who needs a database administrator when we have Google Search?
Here’s the catch: if you never read the actual mysqldump documentation, you won’t know that the lock-tables option prevents changes from happening to database tables while you are exporting them. By deactivating that option, your database export file could contain inconsistent data because something changed during the backup.
Do you know what error message you get when you restore a database from an inconsistent export? Trick question– there isn’t an error message. You’ll only know when you see information in your records that doesn’t make sense.
Scary stuff, isn’t it? Let’s hope no one thinks WebMD is a replacement for professional medical care.