Apr 16th: Ideally MySQL include this in a future version of mysqldump
, but here's a neat little utility to split extended inserts into one row per line. This allows you to use extended inserts (for much faster importing of large tables) while having the ability to grep and diff rows easily.
There are two answers guaranteed to show up on nearly every PHP question on Stack Overflow - use the mysqli/PDO extension instead of the deprecated mysql one (to avoid SQL injection), and that you can't parse HTML with regular expressions.
With that in mind, my favorite two answers:
- [How PDO is still vulnerable to SQL injection attacks](http://stackoverflow.com/questions/134099/are-pdo-prepared-statements-sufficient-to-prevent-sql-injection/12202218#12202218) by Anthony Ferrara
- [Parsing HTML with regular expressions](http://stackoverflow.com/questions/4231382/regular-expression-pattern-not-matching-anywhere-in-string/4234491#4234491) by Tom Christiansen
jeremy cole has finally solved the mysql swapping-for-no-reason issue. very nice work [via ph]
noting these down for later reference - two excellent answers on quora from adam d'angelo on why quora uses mysql instead of postgres or a nosql solution. he says everything i've been saying for the last few years, but more eloquently
a couple of interesting alternatives to phpMyAdmin, both simpler: sqlbuddy looks like a really well done minimalist effort, while phpMiniAdmin like like PMA from 10 years ago.
xtrabackup sounds like really good news for people backing up large innodb instances. streaming backups? yes pls
dathan's mysql blog is full of useful tips for people using mysql on a large scale. a kind of "advanced mysql hacks" book done right.
mike b pointed me to this bizarre article from IBM's daniel sabbah describes lamp as "going to have to grow up at some point". err, right. because lamp clearly doesn't scale. it's not like the biggest websites in the world use it. ryan tomayko's response is on the mark.
backed up for later - the innodb hot backup script. faster than restoring from a dump, but more prone to corruption.
gah. f was down for 5 hours after a routine database modification revealed massive innodb corruption which had somehow replicated to the slave. after splitting the cluster, our last backup was nine days old and a few million records short. eek. so a painstaking search and destroy for bad records was conducted. stupid mysql.
phpMyAdmin doesn't yet have support for NDB - looks like someone dropped the ball.
this is a good tutorial on mysql clustering. maybe when the new hardware arrives in the office we can give it a trial.