Copyright ©1997-2011 Glenn Fleishman except as noted otherwise. All rights reserved. For permission to reprint, contact Glenn Fleishman at glenn at glennf.com. Photo © 2008 Laurence Chen; used with permission.
Turning technology from mumbo-jumbo into rich tasty gumbo
< Snips and Snails and Ethernet Tails | Main | Benjamin Has Left the Swaddle >This one goes out to the MySQL administrators out there who were baffled, like me, why when they upgraded through their normal process from 4.1.8 to 4.1.9 (or to 4.1.10) their invocation scripts broke given them strange and annoying errors. The reason is that the MySQL developers changed the context into which mysqld is launched via safe_mysqld. I'm writing this post so it can be found with a clear answer (much clearer than is documented over the MySQL developer's site) on how to fix it.
I have two instances of MySQL running on a dual-processor machine in order to balance load. This made a large difference when I split up databases of equal utility among them. So I invoke them by defining a my.cnf file in /etc/ with settings applicable to both, and then I have a my.main.cnfand my.second.cnf set of files that are particular with ports, sockets, and other details.
I invoke mysqld as
mysqld_safe --defaults-extra-file=/etc/my.main.cf
mysqld_safe --defaults-extra-file=/etc/my.second.cf
Now this stopped working when I upgraded from 4.1.8 to 4.1.9. I stepped backwards assuming a bug and didn't have time to deal with it. The other night I tried to jump to 4.1.10. Same problem. I start reading bug reports and resolutions and release notes and find an obscure note about the data directory being resolved to a path relative to mysqld if mysqld is invoked via mysqld_safe through a relative means. This didn't make complete sense as I had defined the datadir in my .cnf files.
But there you go: I had to add an explicit --datadir declaration into the safe launching:
mysqld_safe --defaults-extra-file=/etc/my.main.cf --datadir=/path/mysql
mysqld_safe --defaults-extra-file=/etc/my.second.cf --datadir=/path/mysql_second
Then it worked. Really frustrating, and it took me about 45 minutes to sort it out because the behavior is inconsistent. I'm not sure whether it's a bug or just something that you can no longer define within a .cnf file. I've added a note to the bug report to see whether they'll either deprecate use of datadir within configuration files or fix this problem.
Posted by Glennf at February 20, 2005 2:50 PM
TrackBack URL for this entry:
MegaGlennFeed
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 |
Recent Entries
Archives
October 2011 | August 2011 | June 2011 | May 2011 | February 2011 | December 2010 | November 2010 | October 2010 | September 2010 | August 2010 | July 2010 | June 2010 | May 2010 | April 2010 | January 2010 | December 2009 | November 2009 | October 2009 | September 2009 | August 2009 | July 2009 | May 2009 | April 2009 | March 2009 | February 2009 | January 2009 | December 2008 | November 2008 | October 2008 | September 2008 | August 2008 | July 2008 | June 2008 | May 2008 | April 2008 | March 2008 | February 2008 | January 2008 | December 2007 | November 2007 | October 2007 | September 2007 | August 2007 | July 2007 | June 2007 | May 2007 | April 2007 | March 2007 | February 2007 | January 2007 | December 2006 | November 2006 | October 2006 | September 2006 | August 2006 | July 2006 | June 2006 | May 2006 | April 2006 | March 2006 | February 2006 | January 2006 | December 2005 | November 2005 | October 2005 | September 2005 | August 2005 | July 2005 | June 2005 | May 2005 | April 2005 | March 2005 | February 2005 | January 2005 | December 2004 | November 2004 | October 2004 | September 2004 | August 2004 | July 2004 | June 2004 | May 2004 | April 2004 | March 2004 | February 2004 | January 2004 | December 2003 | November 2003 | October 2003 | September 2003 | August 2003 | July 2003 | June 2003 | May 2003 | April 2003 | March 2003 | February 2003 | January 2003 | December 2002 | November 2002 | October 2002 | September 2002 | August 2002 | July 2002 | June 2002 | May 2002 | April 2002 | March 2002 | February 2002 | January 2002 | December 2001 | November 2001 | October 2001 |