Posted on March 8, 2010, 10:47 pm, by Michael Zhang, under
Uncategorized.
I find MySQL’s error messages pretty annoying due to how vague they usually are.
SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near blah blah blah at line #
Not helpful.
I was doing a very simple INSERT into a [...]
Posted on February 11, 2010, 2:39 pm, by Michael Zhang, under
Uncategorized.
Discovered today that I was getting the wrong id back when trying to do insert_id() on a MySQL connection that previously ran a INSERT… ON DUPLICATE KEY UPDATE…. The problem is that ordinarily on inserts, LAST_INSERT_ID() returns the auto_increment value that was used in the insert. However, when the query updates instead because a key [...]
Posted on January 6, 2009, 3:04 pm, by Michael Zhang, under
Uncategorized.
If you’re getting too many MySQL threads or Apache connections, and you would like to debug them, here are two possible ways to get the info you need:
Apache
fullstatus – Displays a full status report from mod_status. For this to work, you need to have mod_status enabled on your server [...]