<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MySQL Expert &#124; MySQL Performance &#124; MySQL Consulting</title>
	<atom:link href="http://ronaldbradford.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://ronaldbradford.com/blog</link>
	<description>Expert times and information on MySQL</description>
	<lastBuildDate>Fri, 12 Mar 2010 22:46:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Understanding Drizzle user authentication options &#8211; Part 2</title>
		<link>http://ronaldbradford.com/blog/understanding-drizzle-user-authentication-options-part-2010-03-12/</link>
		<comments>http://ronaldbradford.com/blog/understanding-drizzle-user-authentication-options-part-2010-03-12/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 22:45:26 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[authentication]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2639</guid>
		<description><![CDATA[A key differentiator in Drizzle from it&#8217;s original MySQL roots is user based authentication.  Gone is the host/user and schema/table/column model that was stored in the MyISAM based mysql.user table.
Authentication is now completely pluggable, leveraging existing systems such as PAM, LDAP via PAM and Http authentication.
In this post I&#8217;ll talk about HTTP authentication which [...]]]></description>
			<content:encoded><![CDATA[<p>A key differentiator in <a href="http://drizzle.org">Drizzle</a> from it&#8217;s original <a href="http://mysql.com">MySQL</a> roots is user based authentication.  Gone is the host/user and schema/table/column model that was stored in the MyISAM based mysql.user table.</p>
<p>Authentication is now completely pluggable, leveraging existing systems such as <a href="http://en.wikipedia.org/wiki/Pluggable_Authentication_Modules">PAM</a>, <a href="http://en.wikipedia.org/wiki/LDAP">LDAP</a> via PAM and <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">Http authentication</a>.</p>
<p>In this post I&#8217;ll talk about <b>HTTP authentication</b> which requires an external http server to implement successfully.  You can look at <a href="http://ronaldbradford.com/blog/understanding-drizzle-authentication-options-part-1-2010-03-12/">Part 1</a> for PAM authentication.</p>
<h4>Compiling for http auth support</h4>
<p>By default during compilation you may find.</p>
<pre>
checking for libcurl... no
configure: WARNING: libcurl development lib not found: not building auth_http plugin. On Debian this is found in libcurl4-gnutls-dev. On RedHat it's in libcurl-devel.
</pre>
<p>In my case I needed:</p>
<pre>
$ sudo yum install curl-devel
</pre>
<p>NOTE: <a href="https://bugs.launchpad.net/drizzle/+bug/527255">Bug #527255</a> talks about issues of the message being incorrect for libcurl-devel however this appears it may be valid in Fedora Installs</p>
<p>After successfully installing the necessary pre-requisite you should see.</p>
<pre>
checking for libcurl... yes
checking how to link with libcurl... -lcurl
checking if libcurl has CURLOPT_USERNAME... no
</pre>
<h3>HTTP Authentication</h3>
<p>We need to enable the plugin at server startup.</p>
<pre>
$ sbin/drizzled --mysql-protocol-port=3399 --plugin_add=auth_http &#038;
</pre>
<p>You need to ensure the auth_http plugin is active by checking the data dictionary plugin table.</p>
<pre>
drizzle> select * from data_dictionary.plugins where plugin_name='auth_http';
+-------------+----------------+-----------+-------------+
| PLUGIN_NAME | PLUGIN_TYPE    | IS_ACTIVE | MODULE_NAME |
+-------------+----------------+-----------+-------------+
| auth_http   | Authentication | TRUE      |             |
+-------------+----------------+-----------+-------------+
</pre>
<p>The auth_http plugin also has the following system variables.</p>
<pre>
drizzle> SHOW GLOBAL VARIABLES LIKE '%http%';
+------------------+-------------------+
| Variable_name    | Value             |
+------------------+-------------------+
| auth_http_enable | OFF               |
| auth_http_url    | http://localhost/ |
+------------------+-------------------+
2 rows in set (0 sec)
</pre>
<p>In order to configure Http authentication, you need to have the following settings added to your drizzled.cnf file. For example:</p>
<pre>
$ cat etc/drizzled.cnf
[drizzled]
auth_http_enable=TRUE
auth_http_url=http://thedrizzler.com/auth
</pre>
<p>NOTE: Replace the domain name with something you have, even localhost.</p>
<p>A Drizzle restart gives us</p>
<pre>
$ bin/drizzle -e "SHOW GLOBAL VARIABLES LIKE 'auth_http%'"
+------------------+-----------------------------+
| Variable_name    | Value                       |
+------------------+-----------------------------+
| auth_http_enable | ON                          |
| auth_http_url    | http://thedrizzler.com/auth |
+------------------+-----------------------------+
</pre>
<p>By default, currently if the settings result in an invalid url, then account validation does not fail and you can still login.  It is recommended that you always configure pam authentication as well as a fall back.</p>
<pre>
$ wget -O tmp http://thedrizzler.com/auth
--17:32:32--  http://thedrizzler.com/auth
Resolving thedrizzler.com... 208.43.73.220
Connecting to thedrizzler.com|208.43.73.220|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
17:32:32 ERROR 404: Not Found.

$ bin/drizzle
drizzle > exit
</pre>
<h3>Configuring passwords</h3>
<p>To correctly configured your web server to perform the HTTP auth, you can use this Apache syntax as an example.</p>
<p>The following is added to the VirtualHost entry in your web browser.</p>
<pre>
&lt;Directory /var/www/drizzle/auth>
AllowOverride FileInfo All AuthConfig
AuthType Basic
AuthName "Drizzle Access Only"
AuthUserFile /home/drizzle/.authentication
Require valid-user
&lt;/Directory>
</pre>
<pre>
$ sudo su -
$ mkdir /var/www/drizzle/auth
$ touch /var/www/drizzle/auth/index.htm
$ apachectl graceful
</pre>
<p>We check we now need permissions for the URL.</p>
<pre>
$ wget -O tmp http://thedrizzler.com/auth
--17:35:48--  http://thedrizzler.com/auth
Resolving thedrizzler.com... 208.43.73.220
Connecting to thedrizzler.com|208.43.73.220|:80... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.
</pre>
<p>You need to create the username/password for access.</p>
<pre>
$ htpasswd -cb /home/drizzle/.authentication testuser sakila
$ cat /home/drizzle/.authentication
testuser:85/7CbdeVql4E
</pre>
<p>Confirm that the http auth with correct user/password works.</p>
<pre>
$ wget -O tmp http://thedrizzler.com/auth --user=testuser --password=sakila
--17:37:45--  http://thedrizzler.com/auth
Resolving thedrizzler.com... 208.43.73.220
Connecting to thedrizzler.com|208.43.73.220|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
</pre>
<h3>Drizzle HTTP Authentication in action</h3>
<p>By default we now can&#8217;t login</p>
<pre>
$ bin/drizzle
ERROR 1045 (28000): Access denied for user ''@'127.0.0.1' (using password: NO)
</pre>
<pre>
$ bin/drizzle --user=testuser --password=sakila999
ERROR 1045 (28000): Access denied for user 'testuser'@'127.0.0.1' (using password: YES)

$ bin/drizzle --user=testuser --password=sakila
Welcome to the Drizzle client..  Commands end with ; or \g.
Your Drizzle connection id is 6
Server version: 7 Source distribution (trunk)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

drizzle>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/understanding-drizzle-user-authentication-options-part-2010-03-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Drizzle user authentication options &#8211; Part 1</title>
		<link>http://ronaldbradford.com/blog/understanding-drizzle-authentication-options-part-1-2010-03-12/</link>
		<comments>http://ronaldbradford.com/blog/understanding-drizzle-authentication-options-part-1-2010-03-12/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 21:46:49 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Professional]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1976</guid>
		<description><![CDATA[A key differentiator in Drizzle from it&#8217;s original MySQL roots is user based authentication.  Gone is the host/user and schema/table/column model that was stored in the MyISAM based mysql.user table.
Authentication is now completely pluggable, leveraging existing systems such as PAM, LDAP via PAM and Http authentication.
In this post I&#8217;ll talk about PAM authentication which [...]]]></description>
			<content:encoded><![CDATA[<p>A key differentiator in <a href="http://drizzle.org">Drizzle</a> from it&#8217;s original <a href="http://mysql.com">MySQL</a> roots is user based authentication.  Gone is the host/user and schema/table/column model that was stored in the MyISAM based mysql.user table.</p>
<p>Authentication is now completely pluggable, leveraging existing systems such as <a href="http://en.wikipedia.org/wiki/Pluggable_Authentication_Modules">PAM</a>, <a href="http://en.wikipedia.org/wiki/LDAP">LDAP</a> via PAM and <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">Http authentication</a>.</p>
<p>In this post I&#8217;ll talk about <b>PAM authentication</b> which is effectively your current Linux based user security.</p>
<p>This information is based on the current <a href="http://blog.drizzle.org/2010/03/02/drizzle-build-1317-source-tarball-has-been-released/">build 1317</a>.</p>
<h3>Compiling for PAM support</h3>
<p>Your Drizzle environment needs to be compiled with PAM support. You would have received the following warning during a configure.</p>
<pre>
$ ./configure
...
checking for libpam... no
configure: WARNING: Couldn't find PAM development support, pam_auth will not be built. On Debian, libpam is in libpam0g-dev. On RedHat it's in pam-devel.
</pre>
<p>The solution is provided in the warning message which is another great thing about Drizzle. The pre checks for dependencies and the optional messages like these far exceed the MySQL equivalent compilation process.  In my case:</p>
<pre>
$ sudo yum install pam-devel
</pre>
<p>When correctly configured, it should look like:</p>
<pre>
checking for libpam... yes
checking how to link with libpam... -lpam
</pre>
<h3>Working with PAM</h3>
<p>You need to enable the PAM authentication plugin at drizzled startup.</p>
<pre>
sbin/drizzled --plugin_add=auth_pam &#038;
</pre>
<p>Unfortunately connecting fails to work with </p>
<pre>
time sbin/drizzle --user=testuser --password=***** --port=4427
real 0m0.003s
user 0m0.003s
sys 0m0.001s
</pre>
<p>A look into the source at src/drizzle-2010.03.1317/plugin/auth_pam/auth_pam.cc shows a needed config file</p>
<pre>
117     retval= pam_start("check_user", userinfo.name, &#038;conv_info, &#038;pamh);
</pre>
<h4>Configuring PAM</h4>
<p>In order to enable PAM with Drizzle you need to have the following system configuration.</p>
<pre>
$ cat /etc/pam.d/check_user
auth    required        pam_unix.so
account required        pam_unix.so

$ time sbin/drizzle --user=testuser --password=***** --port=4427
ERROR 1045 (28000): Access denied for user 'testuser'@'127.0.0.1' (using password: YES)

real 0m2.055s
user 0m0.002s
sys 0m0.002s
</pre>
<p>This did some validation but still failed.</p>
<p>It seems <a href="https://bugs.launchpad.net/drizzle/+bug/484069">Bug #484069</a> may fix this problem, however this is not currently in the main line!</p>
<p>Stay Tuned!</p>
<p><!--<br />
You first need to ensure the pam plugin is active by checking the data dictionary plugin table.</p>
<pre>
drizzle> select * from data_dictionary.plugins where plugin_name=&#8217;pam&#8217;;
+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;-+
| PLUGIN_NAME | PLUGIN_VERSION | PLUGIN_STATUS | PLUGIN_AUTHOR | PLUGIN_DESCRIPTION       | PLUGIN_LICENSE |
+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;-+
| pam         | 0.1            | ACTIVE        | Brian Aker    | PAM based authenication. | GPL            |
+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;-+
1 row in set (0 sec)
</pre>
<p>--></p>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/understanding-drizzle-authentication-options-part-1-2010-03-12/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gearman examples under Mac OS X</title>
		<link>http://ronaldbradford.com/blog/gearman-examples-under-mac-os-x-2010-03-12/</link>
		<comments>http://ronaldbradford.com/blog/gearman-examples-under-mac-os-x-2010-03-12/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 19:20:36 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Gearman]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2629</guid>
		<description><![CDATA[Today I listened in on the O&#8217;Reilly webcast  Introduction to Gearman by Eric Day of Rackspace.  I thought I would follow through on the machine at hand; a Mac with OS X 10.5, however I again got caught up with the gearman PHP extension integration.  A look at and older post Getting [...]]]></description>
			<content:encoded><![CDATA[<p>Today I listened in on the O&#8217;Reilly webcast  <a href="http://www.oreillynet.com/pub/e/1564">Introduction to Gearman</a> by Eric Day of Rackspace.  I thought I would follow through on the machine at hand; a Mac with OS X 10.5, however I again got caught up with the gearman PHP extension integration.  A look at and older post <a href="http://ronaldbradford.com/blog/getting-started-with-gearman-2009-07-26/">Getting started with Gearman</a> based on Ubuntu needed an update for Mac.</p>
<p>First I downloaded and installed the latest <a href="http://gearman.org">gearman</a>. This was version 0.12 and includes libgearman 0.7.<br />
<b>You should always check for any more recent updates.</b></p>
<pre>
wget http://launchpad.net/gearmand/trunk/0.12/+download/gearmand-0.12.tar.gz
tar xvfz gearmand-0.12.tar.gz
cd gearmand-0.12
./configure
make
sudo make install
ls -l /usr/local/lib/libg*
#-rwxr-xr-x  1 root  wheel  79808 Mar 12 13:33 /usr/local/lib/libgearman.4.dylib
#lrwxr-xr-x  1 root  wheel     18 Mar 12 13:33 /usr/local/lib/libgearman.dylib -> libgearman.4.dylib
#-rwxr-xr-x  1 root  wheel    960 Mar 12 13:33 /usr/local/lib/libgearman.la
</pre>
<p>gearmand was installed in /usr/local/sbin and gearman installed in /usr/local/bin</p>
<p>Next we needed the gearman PHP extension from <a href="http://pecl.php.net/package/gearman">pecl</a></p>
<pre>
wget http://pecl.php.net/get/gearman-0.7.0.tgz
tar xvfz gearman-0.7.0.tgz
cd gearman-0.7.0
phpize
./configure
make
sudo make install
# Installing shared extensions:     /usr/lib/php/extensions/no-debug-non-zts-20060613/
</pre>
<p>Take note of the extension location, as I needed this for the next step.</p>
<p>Php was already installed, which was good.</p>
<pre>
$ which php
/usr/bin/php
</pre>
<p>However I found no configuration loaded.</p>
<pre>
$ php --info | grep -i configuration
Configuration File (php.ini) Path => /etc
Loaded Configuration File => (none)
Configuration
</pre>
<p>What exists is a default example only.  In order to include the gearman extension I needed to do the following.</p>
<pre>
$ sudo cp /etc/php.ini.default /etc/php.ini
$ sudo vi /etc/php.ini

# Set extension directory
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613/"
# Add Gearman extension
extension="gearman.so"
</pre>
<p>And a confirmation.</p>
<pre>
$ php --info | egrep -i "(configuration|gearman)"
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /private/etc/php.ini
Configuration
gearman
gearman support => enabled
libgearman version => 0.12
</pre>
<p>Ready now to try out the PHP examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/gearman-examples-under-mac-os-x-2010-03-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using ext4 for MySQL</title>
		<link>http://ronaldbradford.com/blog/using-ext4-for-mysql-2010-03-12/</link>
		<comments>http://ronaldbradford.com/blog/using-ext4-for-mysql-2010-03-12/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 16:51:32 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[disk performance]]></category>
		<category><![CDATA[ext4]]></category>
		<category><![CDATA[raid]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2623</guid>
		<description><![CDATA[This week with a client I saw ext4 used for the first time on a production MySQL system which was running Ubuntu 9.10 (Karmic Koala).  I observe today while installing 9.10 Server locally that ext4 is the default option.  The ext4 filesystem is described as better performance, reliability and features while there is [...]]]></description>
			<content:encoded><![CDATA[<p>This week with a client I saw ext4 used for the first time on a production MySQL system which was running <a href="http://releases.ubuntu.com/releases/9.10/">Ubuntu 9.10 (Karmic Koala)</a>.  I observe today while installing 9.10 Server locally that ext4 is the default option.  The ext4 filesystem is described as better performance, reliability and features while there is also information about improvements in journaling.</p>
<p>At OSCON 2009 I attended a presentation on <a href="http://www.oscon.com/oscon2009/public/schedule/detail/8432">Linux Filesystem Performance for Databases</a> by <a href="http://twitter.com/Selenamarie">Selena Deckelmann</a> in which ext4 was included.  While providing some improvements in sequential reading and writing, there were issue with random I/O which is the key for RDBMS products.  </p>
<p>Is the RAID configuration (e.g. RAID 5, RAID 10), strip size, buffer caches, LVM etc more important then upgrading from ext3 to ext4?   I don&#8217;t have access to any test equipment in order to determine myself however I&#8217;d like to know of any experiences from members of the MySQL community and if anybody has experienced any general problems running ext4.</p>
<h3>ext4 References</h3>
<ul>
<li><a href="http://ext4.wiki.kernel.org/index.php/Ext4_Howto">Ext 4 How To</a> on kernel.org</li>
<li><a href="http://kernelnewbies.org/Ext4">Ext4</a> on kernelnewbies.org</li>
<li><a href="http://en.wikipedia.org/wiki/Ext4">ext4</a>ext4 overview</a> via wikipedia.org</li>
<li><a href="http://www.linuxinsight.com/first_benchmarks_of_the_ext4_file_system.html">First benchmarks of the ext4 file system</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/using-ext4-for-mysql-2010-03-12/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Drizzle&#8217;s Data Dictionary and Global Status</title>
		<link>http://ronaldbradford.com/blog/drizzles-data-dictionary-and-global-status-2010-03-11/</link>
		<comments>http://ronaldbradford.com/blog/drizzles-data-dictionary-and-global-status-2010-03-11/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 21:33:14 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[data dictionary]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2617</guid>
		<description><![CDATA[With the recent news by Brian about the Data Dictionary in Drizzle replacing the INFORMATION_SCHEMA, I was looking into the server status variables (aka INFORMATION_SCHEMA.GLOBAL_STATUS) and I came across an interesting discovery.

select * from data_dictionary.global_status;
...
&#124; Table_locks_immediate      &#124; 0             [...]]]></description>
			<content:encoded><![CDATA[<p>With the recent news by Brian about the <a href="http://krow.livejournal.com/685840.html">Data Dictionary</a> in Drizzle replacing the INFORMATION_SCHEMA, I was looking into the server status variables (aka INFORMATION_SCHEMA.GLOBAL_STATUS) and I came across an interesting discovery.</p>
<pre>
select * from data_dictionary.global_status;
...
| Table_locks_immediate      | 0              |
| Table_locks_waited         | 0              |
| Threads_connected          | 8134064        |
| Uptime                     | 332            |
| Uptime_since_flush_status  | 332            |
+----------------------------+----------------+
51 rows in set (0 sec)
</pre>
<p>This only retrieved 51 rows, which is way less then previous.  What I wanted was clearly missing, all the old com_ status variables. Looking at what the data_dictionary actually has available revealed a new table.</p>
<pre>
drizzle> select * from data_dictionary.global_statements;
+-----------------------+----------------+
| VARIABLE_NAME         | VARIABLE_VALUE |
+-----------------------+----------------+
| admin_commands        | 0              |
| alter_db              | 0              |
| alter_table           | 0              |
| analyze               | 0              |
| begin                 | 0              |
| change_db             | 1              |
| check                 | 0              |
| checksum              | 0              |
| commit                | 0              |
| create_db             | 0              |
| create_index          | 0              |
| create_table          | 0              |
| delete                | 0              |
| drop_db               | 0              |
| drop_index            | 0              |
| drop_table            | 0              |
| empty_query           | 0              |
| flush                 | 0              |
| insert                | 0              |
| insert_select         | 0              |
| kill                  | 0              |
| load                  | 0              |
| release_savepoint     | 0              |
| rename_table          | 0              |
| replace               | 0              |
| replace_select        | 0              |
| rollback              | 0              |
| rollback_to_savepoint | 0              |
| savepoint             | 0              |
| select                | 10             |
| set_option            | 0              |
| show_create_db        | 0              |
| show_create_table     | 0              |
| show_errors           | 0              |
| show_warnings         | 0              |
| truncate              | 0              |
| unlock_tables         | 0              |
| update                | 0              |
+-----------------------+----------------+
38 rows in set (0 sec)
</pre>
<p>Kudos to this.  Looking at list I saw an obvious omission, of &#8220;ping&#8221;. Something that caught me out some years ago with huge (300-500 per second admin_commands).  I&#8217;m also a fan of Mark&#8217;s recent work <a href="http://www.markleith.co.uk/?p=327">An evening hack &#8211; Com_ping</a> in MySQL. </p>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/drizzles-data-dictionary-and-global-status-2010-03-11/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Upgrading my Google G1 dev phone to Android 1.6</title>
		<link>http://ronaldbradford.com/blog/upgrading-my-google-g1-dev-phone-to-android-1-6-2010-03-11/</link>
		<comments>http://ronaldbradford.com/blog/upgrading-my-google-g1-dev-phone-to-android-1-6-2010-03-11/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:02:02 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[donut]]></category>
		<category><![CDATA[g1]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2606</guid>
		<description><![CDATA[To update your Google G1 phone (mine is an Android developer unlocked phone) to Android 1.6 (Donut), I did the following.

Download and unpack the Android SDK for Mac OS X from http://developer.android.com/sdk/index.html
Download the Android 1.6 Radio and System Images from http://developer.htc.com/adp.html
Reboot phone with USB connected
Update the Device Radio Firmware

Confirm devices with $ adb devices  [...]]]></description>
			<content:encoded><![CDATA[<p>To update your Google G1 phone (mine is an Android developer unlocked phone) to Android 1.6 (Donut), I did the following.</p>
<ul>
<li>Download and unpack the Android SDK for Mac OS X from <a href="http://developer.android.com/sdk/index.html">http://developer.android.com/sdk/index.html</a></li>
<li>Download the Android 1.6 Radio and System Images from <a href="http://developer.htc.com/adp.html">http://developer.htc.com/adp.html</a></li>
<li>Reboot phone with USB connected</li>
<li>Update the Device Radio Firmware
<ul>
<li>Confirm devices with $ adb devices    This step drove me crazy because it would list no devices. It ended up being a faulty (and new) USB cable.  When your phone is connected to USB, it will give you a notification, and usb icon on phone top menu.</li>
<li>Copy Radio image</li>
<li>Reboot in recovery mode and follow instructions</li>
</ul>
</li>
<li>Download the fastboot for Mac OS X at <a href="http://developer.htc.com/adp.html">http://developer.htc.com/adp.html</a></li>
<li>Flash the System Image Package to the Device as per instructions</a>
</ul>
<p>The instructions say to reboot, but in my case it rebooted automatically after the fastboot update.</p>
<p>The problem after reboot was I was unable to sign in to google servers the first time.  At <a href="http://www.google.com/support/forum/p/Google%20Mobile/thread?tid=0a3c51ad7f94e73d&#038;hl=en">G1 Dev Phone won&#8217;t connect to Google servers with valid SIM card</a> I added the necessary AT&#038;T/Cingular APN via details at <a href="http://modmyi.com/wiki/index.php/Carrier_APN_Settings">http://modmyi.com/wiki/index.php/Carrier_APN_Settings</a>.</p>
<p>I could then go Settings | Data synchronization and continue the Google registration process.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/upgrading-my-google-g1-dev-phone-to-android-1-6-2010-03-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How do I identify the MySQL my.cnf file?</title>
		<link>http://ronaldbradford.com/blog/how-do-i-identify-the-mysql-my-cnf-file-2010-03-09/</link>
		<comments>http://ronaldbradford.com/blog/how-do-i-identify-the-mysql-my-cnf-file-2010-03-09/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 19:14:19 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[my.cnf]]></category>
		<category><![CDATA[mysql configuration]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2599</guid>
		<description><![CDATA[As part of my upcoming FREE my.cnf check advice I first need to ask people to provide the current MySQL configuration file commonly found as a file named my.cnf 
If only that question was easy to answer!
Use of configuration files
MySQL will by default use at least one configuration file from the following defaults.  MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>As part of my upcoming <a href="/blog/free-advice-on-your-my-cnf-2010-03-08/">FREE my.cnf check advice</a> I first need to ask people to provide the current MySQL configuration file commonly found as a file named <b>my.cnf</b> </p>
<p>If only that question was easy to answer!</p>
<h3>Use of configuration files</h3>
<p>MySQL will by default use at least one configuration file from the following defaults.  MySQL also uses a cascade approach for configuration files.  When you have multiple files in the appropriate paths you can see unexpected behavior when you override certain values in different files.</p>
<p>You can however for example specify &#8211;no-defaults to use no configuration file, or add options to your command line execution, so even looking at all configuration files is no guarantee of your operating configuration.</p>
<p>However for most environments, these complexities do not exist.</p>
<h3>Default Location</h3>
<p>By default and on single instance MySQL servers you are most likely to find this file called <b>my.cnf</b> and found at:</p>
<ul>
<li>/etc/my.cnf</li>
<li>/etc/mysql/my.cnf</li>
</ul>
<p>These are known as the global options files. </p>
<h3>Alternative Locations</h3>
<p>MySQL has both instance specific and user specific locations.  For the inclusion of an instance specific file, the location is:</p>
<ul>
<li>$MYSQL_HOME/my.cnf</li>
</ul>
<p>where MYSQL_HOME is a defined environment variable.  Historical MySQL versions also looked at [datadir]/my.cnf however I am unaware if this is applicable in 5.x versions.</p>
<p>You can also specific options on a per user basis for default inclusion. These are found at:</p>
<ul>
<li>$HOME/.my.cnf</li>
</ul>
<h3>Distro specific locations</h3>
<p> Ubuntu for example also provides an ability to add options via an include directory.  </p>
<h3>Specifying a configuration at runtime</h3>
<p>While you may have these default files, you may elect to start mysql with a specific configuration file as specified by &#8211;defaults-file.  This option will override all global/instance/user locations and use just this configuration file.  You can also specify additional configuration that supplements and not overrides the default with &#8211;defaults-extra-file.</p>
<h3>What files are on my system?</h3>
<p>Again, assuming the default names you can perform a brute force check with:</p>
<pre>
$ sudo find / -name "*my*cnf"
</pre>
<p>This is actually worthwhile, especially if you find a /root/.my.cnf file which is default MySQL settings for the Operating System &#8216;root&#8217; user.</p>
<h3>MySQL recommendations</h3>
<p>MySQL by default provides a number of recommended files however these are generally outdated especially for newer hardware. These files include my-huge.cnf, my-large.cnf, my-medium.cnf, my-small.cnf and my-innodb-heavy-4G.cnf.  Don&#8217;t assume replacing your configuration with one of these files will make your system perform better.</p>
<p>MySQL made some attempt to correct these and at least some very poor defaults with MySQL 5.4 however I am unsure what&#8217;s in MySQL 5.5</p>
<h3>MySQL Configuration at runtime</h3>
<p>While several commands can help with identifying your configuration files and print defaults etc, it&#8217;s also possible to change your configuration at runtime.  It&#8217;s possible that these changes are not reflected in your configuration files and pose an additional mismatch.</p>
<h3>References</h3>
<ul>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/option-files.html">Using Option Files</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/server-options.html">Server Command Options</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/how-do-i-identify-the-mysql-my-cnf-file-2010-03-09/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Assume  &#8211; Per Session Buffers</title>
		<link>http://ronaldbradford.com/blog/dont-assume-per-session-buffers-2010-03-08/</link>
		<comments>http://ronaldbradford.com/blog/dont-assume-per-session-buffers-2010-03-08/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 18:24:25 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[mysql for oracle dba]]></category>
		<category><![CDATA[mysql4oracledba]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2593</guid>
		<description><![CDATA[MySQL has a number of global buffers, i.e. your SGA.  There are also a number of per session/thread buffers that combined with other memory usage constitutes an unbounded PGA.  One of the most common errors in mis-configured MySQL environments is the setting of the 4 primary per session buffers thinking they are global [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL has a number of global buffers, i.e. your SGA.  There are also a number of per session/thread buffers that combined with other memory usage constitutes an unbounded PGA.  One of the most common errors in mis-configured MySQL environments is the setting of the 4 primary per session buffers thinking they are global buffers.</p>
<p>Global buffers include:</p>
<ul>
<ul>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_key_buffer_size">key_buffer_size</a>  – For MyISAM Indexes (note you can define multiple key_buffer’s <a href="http://dev.mysql.com/doc/refman/5.1/en/myisam-key-cache.html">The MyISAM Key Cache</a>)</li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#sysvar_innodb_buffer_pool_size">innodb_buffer_pool_size</a> – For Innodb Table/Indexs</li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#sysvar_innodb_additional_mem_pool_size">innodb_additional_mem_pool_size</a> – Innodb additional data dictionary data</li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_query_cache_size">query_cache_size</a> – The MySQL Query Cache</li>
</ul>
<p>The four important per session buffers are:</p>
<ul>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_read_buffer_size">read_buffer_size</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_read_rnd_buffer_size">read_rnd_buffer_size</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_sort_buffer_size">sort_buffer_size</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_join_buffer_size">join_buffer_size</a></li>
</ul>
<p>I have seen people see these values > 5M.  The defaults range from 128K to 256K.  My advice for any values above 256K is simple. What proof do you have this works better?  When nothing is forthcoming, the first move is to revert to defaults or a maximum of 256K for some benchmarkable results.  The primary reason for this is MySQL internally as quoted by Monty Taylor &#8211; <i>for values > 256K, it uses mmap() instead of malloc() for memory allocation</i>.</p>
<p>These are not all the per session buffers you need to be aware of. Others include thread_stack, max_allowed_packet,binlog_cache_size and most importantly max_connections.</p>
<p>MySQL also uses memory in other areas most noticeably in internal temporary tables and MEMORY based tables.</p>
<p>As I mentioned, there is no bound for the total process memory allocation for MySQL, so some incorrectly configured variables can easily blow your memory usage.</p>
<h3>References</h3>
<ul>
<li><a href="<a href="http://inaugust.com/post/14">Read Buffer performance hit</a> by Monty Taylor</li>
</ul>
<h3>About &#8220;Don&#8217;t Assume&#8221;</h3>
<p><b>&#8220;Don&#8217;t Assume&#8221;</b> is a series of posts to help the Oracle DBA understand, use and appreciate the subtle differences and unique characteristics of the MySQL RDBMS in comparison to Oracle.  These points as essential to operate MySQL effectively in a production environment and avoid any loss of data or availability.</p>
<p>For more posts in this series be sure to follow the <a href="http://ronaldbradford.com/blog/tag/mysql4oracledba/">mysql4oracledba</a> tag and also watch out for <a href="http://MySQL4OracleDBA.com">MySQL for Oracle DBA</a> presentations.</p>
<p>The <b>MySQLCamp for the Oracle DBA</b> is a series of educational talks all Oracle DBA resources should attend.  Two presentations from this series <a href="http://ronaldbradford.com/mysql-oracle-dba/#IGNITION">IGNITION</a> and <a href="http://ronaldbradford.com/mysql-oracle-dba/#LIFTOFF">LIFTOFF</a> will be presented at the <a href="http://en.oreilly.com/mysql2010">MySQL Users Conference 2010</a> in Santa Clara, April 2010   This series also includes <a href="http://ronaldbradford.com/mysql-oracle-dba/#JUMPSTART">JUMPSTART</a> and <a href="http://ronaldbradford.com/mysql-oracle-dba/#VELOCITY">VELOCITY</a>.  If you would like to here these presentations in your area, <a href="http://ronaldbradford.com/contact/">please contact me</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/dont-assume-per-session-buffers-2010-03-08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free advice on your my.cnf</title>
		<link>http://ronaldbradford.com/blog/free-advice-on-your-my-cnf-2010-03-08/</link>
		<comments>http://ronaldbradford.com/blog/free-advice-on-your-my-cnf-2010-03-08/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 17:36:51 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[my.cnf]]></category>
		<category><![CDATA[free advice]]></category>
		<category><![CDATA[mysql configuration]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2588</guid>
		<description><![CDATA[Today, while on IRC in #pentaho I came across a discussion and a published my.cnf.  In this configuration I found some grossly incorrect values for per session buffers (see below).  
It doesn&#8217;t take a MySQL expert to spot the issues, however there is plenty of bad information available on the Internet and developers [...]]]></description>
			<content:encoded><![CDATA[<p>Today, while on IRC in #pentaho I came across a discussion and a published my.cnf.  In this configuration I found some grossly incorrect values for per session buffers (see below).  </p>
<p>It doesn&#8217;t take a MySQL expert to spot the issues, however there is plenty of bad information available on the Internet and developers not knowing MySQL well can easily be mislead. This has spurred me to create a program to rid the world of bad MySQL configuration.  While my task is potential infinite, it will enable me to give back and hopefully do a small amount of good. You never know, saving those CPU cycles may save energy and help the planet.</p>
<p>Stay tuned for more details of my program.</p>
<pre>
[mysqld]
...
sort_buffer_size = 6144K
myisam_sort_buffer_size = 1G
join_buffer_size = 1G
bulk_insert_buffer_size = 1G
read_buffer_size     = 6144K
read_rnd_buffer_size = 6144K
key_buffer_size		= 1024M
max_allowed_packet	= 32M
thread_stack		= 192K
thread_cache_size       = 256

query_cache_limit	= 512M
query_cache_size        = 512M
...
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/free-advice-on-your-my-cnf-2010-03-08/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MySQL is crashing, what do I do?</title>
		<link>http://ronaldbradford.com/blog/mysql-is-crashing-what-do-i-do-2010-03-08/</link>
		<comments>http://ronaldbradford.com/blog/mysql-is-crashing-what-do-i-do-2010-03-08/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 16:34:31 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Professional]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2550</guid>
		<description><![CDATA[Let me start by saying the majority of environments never experience problems of MySQL crashing. I have seen production environments up for years. On my own server I have seen 575 days of MySQL uptime and the problem was hardware, not MySQL.
However it does occur, and the reasons may be obscure.
Confirming mysqld has crashed
To the [...]]]></description>
			<content:encoded><![CDATA[<p>Let me start by saying the majority of environments never experience problems of MySQL crashing. I have seen production environments up for years. On my own server I have seen 575 days of MySQL uptime and the problem was hardware, not MySQL.</p>
<p>However it does occur, and the reasons may be obscure.</p>
<h3>Confirming mysqld has crashed</h3>
<p>To the unsuspecting, MySQL may indeed be crashing and you never know about it. The reason is because most MySQL installations have two running processes, these are mysqld and mysqld_safe. </p>
<pre>
ps -ef | grep mysqld
root     28822     1  0 Feb22 ?        00:00:00 /bin/sh bin/mysqld_safe
mysql    28910 28822  0 Feb22 ?        00:30:08 /opt/mysql51/bin/mysqld --basedir=/opt/mysql51 --datadir=/opt/mysql51/data --user=mysql --log-error=/opt/mysql51/log/error.log --pid-file=/opt/mysql51/data/dc1.onegreendog.com.pid
</pre>
<p>One of the functions of mysqld_safe is to restart mysqld if it fails. Unless you review your mysql error log and for low volume systems you will never know. Hint <a href="http://ronaldbradford.com/blog/have-you-checked-your-mysql-error-log-today-2009-08-20/">Have you checked your MySQL error log today?</a></p>
<p>You can determine quickly via SQL your instance uptime.</p>
<pre>
mysql> SHOW GLOBAL STATUS LIKE '%uptime%';
+---------------+---------+
| Variable_name | Value   |
+---------------+---------+
| Uptime        | 1033722 |
+---------------+---------+
1 row in set (0.00 sec)
</pre>
<p>This is the number of seconds since start time. While not easily readable for humans, this is more user friendly display. (NOTE: Works for 5.1+ only)</p>
<pre>
mysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP() - variable_value) AS server_start
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE variable_name='Uptime';
+---------------------+
| server_start        |
+---------------------+
| 2010-02-22 15:22:13 |
+---------------------+
1 row in set (0.07 sec)
</pre>
<h3>Debugging a mysqld core file</h3>
<p>When correctly configured, mysqld will generate a core file (See <a href="http://ronaldbradford.com/blog/how-to-crash-mysqld-intentionally-2010-03-05/">How to crash mysqld intentionally</a> for background information on required settings).</p>
<p>Your first check is to determine if the mysqld binary used has debugging information and symbols stripped. You need this information not stripped for identifying symbol names. </p>
<pre>
$ file bin/mysqld
bin/mysqld: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0,
dynamically linked (uses shared libs), for GNU/Linux 2.4.0, <b>not stripped</b>
</pre>
<p>You can use gdb and with a backtrace command (bt) you can see a stack trace of calls. This won&#8217;t help the average DBA without C or MySQL internal knowledge greatly, however it&#8217;s essential information to get to the bottom of the problem.</p>
<p>In the following example I&#8217;m going to use <a href="http://bugs.mysql.com/bug.php?id=48508">Bug #38508</a> to intentionally crash my test instance.</p>
<pre>
mysql> drop table if exists t1,t2;
mysql> create table t1(a bigint);
mysql> create table t2(b tinyint);
mysql> insert into t2 values (null);
mysql> prepare stmt from "select 1 from t1 join  t2 on a xor b where b > 1  and a =1";
mysql> execute stmt;
mysql> execute stmt;
<b>ERROR 2013 (HY000): Lost connection to MySQL server during query</b>
</pre>
<p>Lost connection is the first sign of a problem. We check the error log to confirm.</p>
<pre>
$ tail data/`hostname`.err
100306 14:51:49 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=8384512
read_buffer_size=131072
max_used_connections=1
max_threads=151
threads_connected=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 338301 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x521f160
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x401b6100 thread_stack 0x40000
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(my_print_stacktrace+0x2e)[0x8abfbe]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(handle_segfault+0x322)[0x5df252]
/lib64/libpthread.so.0[0x35fb00de80]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_ZN9Item_cond10fix_fieldsEP3THDPP4Item+0x7f)[0x5654ff]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_ZN9Item_cond10fix_fieldsEP3THDPP4Item+0xb8)[0x565538]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_Z11setup_condsP3THDP10TABLE_LISTS2_PP4Item+0xf6)[0x621f96]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_ZN4JOIN7prepareEPPP4ItemP10TABLE_LISTjS1_jP8st_orderS7_S1_S7_P13st_select_lexP18st_select_lex_unit+0x2db)[0x645f3b]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x7a4)[0x654d24]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_Z13handle_selectP3THDP6st_lexP13select_resultm+0x16c)[0x659f9c]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld[0x5ec92a]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_Z21mysql_execute_commandP3THD+0x602)[0x5efb22]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_ZN18Prepared_statement7executeEP6Stringb+0x3bd)[0x66587d]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_ZN18Prepared_statement12execute_loopEP6StringbPhS2_+0x7c)[0x66874c]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_Z22mysql_sql_stmt_executeP3THD+0xa7)[0x668c27]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_Z21mysql_execute_commandP3THD+0x1123)[0x5f0643]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_Z11mysql_parseP3THDPKcjPS2_+0x357)[0x5f5047]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xe93)[0x5f5ee3]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(_Z10do_commandP3THD+0xe6)[0x5f67a6]
/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld(handle_one_connection+0x246)[0x5e9146]
/lib64/libpthread.so.0[0x35fb006307]
/lib64/libc.so.6(clone+0x6d)[0x35fa4d1ded]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x5249320 = select 1 from t1 join  t2 on a xor b where b > 1  and a =1
thd->thread_id=1
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
<strong>Writing a core file</strong>
100306 14:51:49 mysqld_safe Number of processes running now: 0
100306 14:51:49 mysqld_safe mysqld restarted
100306 14:51:49 [Note] Plugin 'FEDERATED' is disabled.
100306 14:51:50  InnoDB: Started; log sequence number 0 44233
100306 14:51:50 [Note] Event Scheduler: Loaded 0 events
100306 14:51:50 [Note] /home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld: ready for connections.
Version: '5.1.38'  socket: '/tmp/mysql.sock.3999'  port: 3999  MySQL Community Server (GPL)
</pre>
<p>Confirming we got the &#8220;Writing a core file&#8221; line, we can find and use this.</p>
<pre>
$ find . -name "core*"
./data/core.23290
</pre>
<pre>
$ gdb bin/mysqld data/core.23290
GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1".

Reading symbols from /lib64/libpthread.so.0...done.
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libcrypt.so.1...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /lib64/libnsl.so.1...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /lib64/libm.so.6...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libgcc_s.so.1...done.
Loaded symbols for /lib64/libgcc_s.so.1
Core was generated by `/home/rbradfor/mysql/mysql-5.1.38-linux-x86_64-glibc23/bin/mysqld --defaults-fi'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000035fb00b142 in pthread_kill () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00000035fb00b142 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000005df285 in handle_segfault (sig=11) at mysqld.cc:2552
#2  <signal handler called>
#3  0x00000000005654ff in Item_cond::fix_fields (this=0x5249dd0, thd=0x521f160, ref=<value optimized out>) at item_cmpfunc.cc:3900
#4  0x0000000000565538 in Item_cond::fix_fields (this=0x52435b8, thd=0x521f160, ref=<value optimized out>) at item_cmpfunc.cc:3912
#5  0x0000000000621f96 in setup_conds (thd=0x521f160, tables=<value optimized out>, leaves=0x52494d0, conds=0x5244e38) at sql_base.cc:7988
#6  0x0000000000645f3b in JOIN::prepare (this=0x5243770, rref_pointer_array=0x5248a90, tables_init=<value optimized out>, wild_num=<value optimized out>, conds_init=<value optimized out>,
    og_num=<value optimized out>, order_init=0x0, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x52488c0, unit_arg=0x5248498) at sql_select.cc:412
#7  0x0000000000654d24 in mysql_select (thd=0x521f160, rref_pointer_array=0x5c3fd0, tables=0x4, wild_num=0, fields=@0x52489c8, conds=0x52435b8, og_num=0, order=0x0, group=0x0, having=0x0,
    proc_param=0x0, select_options=0, result=0x52688a0, unit=0x5248498, select_lex=0x52488c0) at sql_select.cc:2377
#8  0x0000000000659f9c in handle_select (thd=0x521f160, lex=0x52483f8, result=0x52688a0, setup_tables_done_option=0) at sql_select.cc:268
#9  0x00000000005ec92a in execute_sqlcom_select (thd=0x521f160, all_tables=0x52494d0) at sql_parse.cc:5011
#10 0x00000000005efb22 in mysql_execute_command (thd=0x521f160) at sql_parse.cc:2206
#11 0x000000000066587d in Prepared_statement::execute (this=0x5245d60, expanded_query=<value optimized out>, open_cursor=false) at sql_prepare.cc:3579
#12 0x000000000066874c in Prepared_statement::execute_loop (this=0x5245d60, expanded_query=0x401b43c0, open_cursor=false, packet=<value optimized out>, packet_end=<value optimized out>)
    at sql_prepare.cc:3253
#13 0x0000000000668c27 in mysql_sql_stmt_execute (thd=<value optimized out>) at sql_prepare.cc:2524
#14 0x00000000005f0643 in mysql_execute_command (thd=0x521f160) at sql_parse.cc:2215
#15 0x00000000005f5047 in mysql_parse (thd=0x521f160, inBuf=0x5243520 "execute stmt", length=12, found_semicolon=0x401b6060) at sql_parse.cc:5931
#16 0x00000000005f5ee3 in dispatch_command (command=COM_QUERY, thd=0x521f160, packet=0x525fde1 "execute stmt", packet_length=<value optimized out>) at sql_parse.cc:1213
#17 0x00000000005f67a6 in do_command (thd=0x521f160) at sql_parse.cc:854
#18 0x00000000005e9146 in handle_one_connection (arg=dwarf2_read_address: Corrupted DWARF expression.
) at sql_connect.cc:1127
#19 0x00000035fb006307 in start_thread () from /lib64/libpthread.so.0
#20 0x00000035fa4d1ded in clone () from /lib64/libc.so.6
(gdb) quit
</pre>
<p>You can use gdb to obtain additional information based on the type of information available.  </p>
<h3>Now what?</h3>
<p>Is the problem a bug? Is it data corruption? Is it hardware related?  </p>
<p>Gathering the information is the first step in informing you of more detail that will enable you to search, discuss and seek professional advice to address your problem. </p>
<h3>References</h3>
<ul>
<li><a href="http://forge.mysql.com/wiki/MySQL_Internals_Porting#Debugging_a_MySQL_Server">MySQL Internals &#8211; Debugging a MySQL Server</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/crashing.html">What to Do If MySQL Keeps Crashing</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/using-gdb-on-mysqld.html">Debugging mysqld under gdb</a></li>
<li><a href="http://www.shinguz.ch/MySQL/mysql_hunting_the_core.html">Hunting the core</a> &#8211; An old by good intro article to cores and MySQL</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/mysql-is-crashing-what-do-i-do-2010-03-08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
