<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Managing Data</title>
	<atom:link href="http://lstigile.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lstigile.wordpress.com</link>
	<description>MySQL topics</description>
	<lastBuildDate>Thu, 26 Jan 2012 04:36:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='lstigile.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Managing Data</title>
		<link>http://lstigile.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://lstigile.wordpress.com/osd.xml" title="Managing Data" />
	<atom:link rel='hub' href='http://lstigile.wordpress.com/?pushpress=hub'/>
		<item>
		<title>MySQL Workbench Plugin: mforms example and slow query log statistics</title>
		<link>http://lstigile.wordpress.com/2010/09/29/mysql-workbench-plugin-mforms-example-and-slow-query-log-statistics/</link>
		<comments>http://lstigile.wordpress.com/2010/09/29/mysql-workbench-plugin-mforms-example-and-slow-query-log-statistics/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 15:33:23 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[MySQL Workbench]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=197</guid>
		<description><![CDATA[As an update to my prior post, I&#8217;ve added a form to the workbench plugin.  Now, the user can select a slow query log file and generate statistics from it.  The plugin provides information to answer the following questions: What type of queries run most often? What type of queries are the slowest? Which queries access [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=197&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As an update to my prior <a title="Slow Query Log Statistics" href="http://lstigile.wordpress.com/2010/09/15/mysql-workbench-plugin-slow-query-log-statistics/" target="_blank">post</a>, I&#8217;ve added a form to the workbench plugin.  Now, the user can select a slow query log file and generate statistics from it.  The plugin provides information to answer the following questions:</p>
<div id="attachment_201" class="wp-caption alignright" style="width: 310px"><a href="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-28-at-5-06-40-pm.png"><img class="size-medium wp-image-201" title="Screen shot 2010-09-28 at 5.06.40 PM" src="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-28-at-5-06-40-pm.png?w=300&#038;h=246" alt="" width="300" height="246" /></a><p class="wp-caption-text">Figure 1.  Sample plugin form</p></div>
<ul>
<li>What type of queries run most often?</li>
<li>What type of queries are the slowest?</li>
<li>Which queries access the most rows?</li>
<li>Which queries send the most data?</li>
</ul>
<p>The plugin scans the slow query log, aggregates similar queries, and provides summary statistics for each group.  It&#8217;s very similar to the mysqldumpslow perl utility, which is included in the mysql bin folder.  However, as a plugin, it&#8217;s easier to use on a Windows server as it doesn&#8217;t require you to install perl.</p>
<p>If you&#8217;re working to create a MySQL Workbench plugin, this mform code will help provide an example.</p>
<p>This form prompts the user for the output type of the slow query log (file or table), for the location of the slow query log file, and for the sort order: count, query_time, rows_examined, rows_sent. See Figure 1. Sample plugin form.</p>
<p>The plugin generates output similar to the following for queries in the slow query log:</p>
<p style="padding-left:30px;">
<div id="_mcePaste">
<div id="_mcePaste" style="padding-left:30px;"><strong>Statement:</strong> DELETE FROM cache_form WHERE expire != DIGIT AND expire &lt; DIGIT</div>
<div id="_mcePaste" style="padding-left:30px;"><strong>count</strong>: 21</div>
<div id="_mcePaste" style="padding-left:30px;"><strong>average time: </strong>0:00:00.003677</div>
<div id="_mcePaste" style="padding-left:30px;"><strong>slowest sql:</strong> DELETE FROM cache_form WHERE expire != 0 AND expire &lt; 1281722403</div>
<div id="_mcePaste" style="padding-left:30px;"><strong>slowest time:</strong> 0:00:00.075859</div>
<div id="_mcePaste" style="padding-left:30px;"><strong>average rows sent:</strong> 0</div>
<div id="_mcePaste" style="padding-left:30px;"><strong>average rows examined:</strong> 0</div>
<div id="_mcePaste" style="padding-left:30px;"><strong>average lock time:</strong> 0:00:00.003625</div>
</div>
<div style="padding-left:30px;">
<p><strong>Statement:</strong> SELECT data, created, headers, expire, serialized FROM cache_menu WHERE cid = &#8216;STRING&#8217;<br />
<strong>count:</strong> 116<br />
<strong>average time:</strong> 0:00:00.001269<br />
<strong>slowest sql:</strong> SELECT data, created, headers, expire, serialized FROM cache_menu WHERE cid = &#8216;links:secondary-links:tree-data:5d6d3aaaaef5fba302ce62698fa37bbe&#8217;<br />
<strong>slowest time:</strong> 0:00:00.024912&lt;<br />
<strong>average rows sent:</strong> 0<br />
<strong>average rows examined:</strong> 0<br />
<strong>average lock time:</strong> 0:00:00.000071</p>
<p><strong>. . .</strong><br />
<strong>. . .</strong><br />
<strong>. . .</strong></p>
<p><strong> </strong><br />
To add the plugin to your workbench install, create a file named slowquerystats_grt.py, click on the &#8220;show source&#8221; magnifying glass icon below, and copy the code block into the file.  From the Scripting menu in Workbench, call install Plugin/Module File and select the file to be installed.  This plugin requires Workbench version 2.7 or newer.  Once you&#8217;ve installed the plugin, you can run it by opening the <strong>SQL Editor</strong> and selecting <strong>Slow Log Stats</strong> from the <strong>Plugins|Utilities</strong> menu.</p>
<p><pre class="brush: python; collapse: true; light: false; toolbar: true;">import os
import re
from wb import *
import grt
from operator import itemgetter
from mforms import newBox, newButton, newPanel, newTextBox, newRadioButton, newLabel, newSelector, newTextEntry, newCheckBox, SelectorCombobox
from mforms import Utilities, FileChooser
import mforms
import datetime

ModuleInfo = DefineModule(name= &quot;slowlogstats&quot;, author= &quot;lstigile&quot;, version=&quot;0.5&quot;)
@ModuleInfo.plugin(&quot;slowlogstats&quot;, caption= &quot;Slow Log Stats&quot;, input= [wbinputs.currentQueryBuffer()], pluginMenu= &quot;SQL/Utilities&quot;)
@ModuleInfo.export(grt.INT, grt.classes.db_query_QueryBuffer)
#---------------------------------------------
#  Entry point, creates form instance, sets choice for sourcetype (table or file), file location
#  and sort order of results
#---------------------------------------------
def optionPrompt(qbuffer):

  lines = []

  sort = {&quot;query_time&quot;:1, &quot;count&quot;:0, &quot;rows_sent&quot;:3,&quot;rows_examined&quot;:4, &quot;lock_time&quot;:2}

  f = LogParamFrm()

  editor= qbuffer.owner
  editor.addToOutput(&quot;\n&quot;, 1)

  if f.result == mforms.ResultOk:
    if f.rbfile.get_active():
      resultsets = LogFileResultset(f.logfile_path)
      ok= resultsets.open()
      tuples = parseSlowQueryTable(resultsets)
    else:
      editor= qbuffer.owner
      sql = &quot;SELECT * FROM mysql.slow_log order by start_time desc limit 10000;&quot;
      resultsets = editor.executeScript(sql)
      tuples = parseSlowQueryTable(resultsets[0])

    if len(tuples) &lt; 12:
      editor.addToOutput( tuples[0], 1)
      return 0

    tuples = sorted(tuples, key=itemgetter(sort[f.sort_method]), reverse=True)
    lines = printFormat(tuples)
    editor.addToOutput('\n'.join(lines), 0)

    if f.rbfile.get_active(): resultsets.close()

  return 0

#-----------------------------------
# format info to print to screen
#------------------------------------
def printFormat(tuples):
  lines=[]
  for item in tuples:
    (count, ttime, tlock, tsent, texam, maxtime, maxstmt, atime, asent, aexam, alock, statement ) = item
    lines.append('Statement: ' + statement + '\n' + 'count: ' + str(count) + '\n' +
                        'average time:' +  str(atime) + '\n' +
                        'slowest sql: ' + maxstmt + '\n' +
                        'slowest time: ' + str(maxtime) + '\n'
                        'average rows sent: ' + str(asent) + '\n'
                        'average rows examined: ' + str(aexam) + '\n'
                        'average lock time: ' + str(alock) + '\n\n'
                     )
  return lines

#----------------------------
def parseSlowQueryTable(result):
  row_dict = {}
  lines= []

  ok = result.goToFirstRow()

  if ok == 0:
    lines.append('invalid file format, User@Host not found in first 20 entries')
    return lines

  while ok:
    sql = result.stringFieldValueByName('sql_text')
    time = result.stringFieldValueByName('query_time')

    if time[9:]!='':
      time = datetime.timedelta(minutes=int(time[0:2]),
        seconds=int(time[3:5]), microseconds=int(time[6:]))
    else:
      time = datetime.timedelta(hours=int(time[0:2]), minutes=int(time[3:5]),
      seconds=int(time[6:8]))
    timelock = result.stringFieldValueByName('lock_time')
    if timelock[9:]!='':
      timelock = datetime.timedelta(minutes=int(timelock[0:2]),
        seconds=int(timelock[3:5]), microseconds=int(timelock[6:]))
    else:
      timelock = datetime.timedelta(hours=int(timelock[0:2]), minutes=int(timelock[3:5]),
        seconds=int(timelock[6:8]))
    sent = int(result.stringFieldValueByName('rows_sent'))

    examined = int(result.stringFieldValueByName('rows_examined'))

      #Use python regular expression engine to replace variables with STRING or
      #DIGIT  For readability, notes on expression are in comments at bottom of this
      #script.  Modify this expression if SQL statements are not correctly grouped.
    sql = re.sub(r'(?&lt;=[\s\(,&lt;&gt;=][\'\&quot;]).*?(?=[\'\&quot;]\)$|[\'\&quot;]$|[\'\&quot;][\,\)]\s|[\'\&quot;]\s[FROM|' +
                         'ORDER|GROUP|AND|WHERE])', 'STRING', sql)

      #  replace all digits with 'DIGIT'
    sql = re.sub(r'(?&lt;=[-+=\s\(,&lt;&gt;])\d.*?(?=[\s\),\)]|$)','DIGIT', sql)

      #determine if SQL is in row_count dict, if not add statement and count, else increment
      #existing entries
    if not sql in row_dict:
      avgtime = time
      avgrowssent = sent
      avgrowsexamined = examined
      avglocktime = timelock
      totaltime = time
      maxsql = result.stringFieldValueByName('sql_text')
      row = [1,totaltime, timelock, sent, examined, time, maxsql, avgtime,
                   avgrowssent, avgrowsexamined, avglocktime, sql]
      row_dict[sql]=row
    else:
      (count, ttime, tlock, tsent, texam, maxtime, maxstmt, atime, asent, aexam,
           alock, sql) = tuple(row_dict[sql])
      count = count + 1
      ttime = ttime + time

      tlock = tlock + timelock
      tsent = tsent + sent
      texam = texam + examined

      if maxtime &lt; time:
        maxtime = time
        maxstmt = result.stringFieldValueByName('sql_text')

      atime = ttime/count
      asent = tsent/count
      aexam = texam/count
      alock = tlock/count

      row = [count, ttime, tlock, tsent, texam, maxtime, maxstmt, atime, asent, aexam, alock, sql]
      row_dict[sql] = row

    ok = result.nextRow()

  for row in row_dict.values():
    lines.append(tuple(row))

  return tuple(lines)

#------function to format time coming from file into 00:00:00000&quot;
def filetimeformat(s):
  parts = s.split('.')
  sformat = ('%(minutes)02d:%(seconds)02d:%(microseconds)05d'
                  %{'minutes':int(parts[0])//60,'seconds':int(parts[0])%60,
                  'microseconds':int(parts[1])})
  return sformat

########################################################################
##
##  LogFileResultset class
##
##
########################################################################

class LogFileResultset:
  def __init__(self, location ):
    self.location = location
    self.__user = ''

  def open(self):
    try:
      self.file = open(self.location, 'r')
      return 1
    except IOError, e:
      return &quot;Error in file IO: &quot;, e

  def goToFirstRow(self):
    ok = self.nextRow()
    return ok

  def __matchTest(self, pattern, text, groupno):
    match = re.search(pattern, text)
    if match:
      return match.group(groupno)
    else:
      return ''

  def nextRow(self):
    x = 0
    sqlline = []

    self.row = {}

    # walk through 20 lines looking for first instance of User@Host
    # if no entry, return 0
    while self.__user == '':
      x = x+1
      self.__user = self.__matchTest('#\sUser@Host:\s(.*)\n', self.file.readline(),1)
      if x == 20:
        return 0

    line = self.file.readline()

    query_time = self.__matchTest('Query_time:\s(.*)\s\sLock_time:\s(.*)\sRows_sent:\s(.*)' +
                                                      '\s\sRows_examined:\s(.*)', line,1)

    if query_time != '':
      query_time = filetimeformat(query_time)
    lock_time= self.__matchTest('Query_time:\s(.*)\s\sLock_time:\s(.*)\sRows_sent:\s(.*)' +
                                               '\s\sRows_examined:\s(.*)', line,2)
    if lock_time != '':
      lock_time = filetimeformat(lock_time)
    rows_sent= self.__matchTest('Query_time:\s(.*)\s\sLock_time:\s(.*)\sRows_sent:\s(.*)' +
                                                  '\s\sRows_examined:\s(.*)', line,3)
    rows_examined= self.__matchTest('Query_time:\s(.*)\s\sLock_time:\s(.*)\sRows_sent:\s(.*)' +
                                                         '\s\sRows_examined:\s(.*)', line,4)

    # if use databasename in log, the timestamp skips a line
    timestamp = self.__matchTest('SET\stimestamp=(\d*);', self.file.readline(),1)
    if timestamp == '':
      timestamp = self.__matchTest('SET\stimestamp=(\d*);', self.file.readline(),1)

    ##this pseudo do..until loop is designed to find the first User@Host entry, which marks a new record.
    ##When we hit User@Host, we save the record in a class variable since it belongs to the next
   ##record.
    while True:
      line = self.file.readline()
      sqlmatch = re.search(r'#\sTime:\s(.*)\n', line)
      if sqlmatch:  #skip Time: entry for SHOW STATUS type statements
        line = self.file.readline()

      sqlmatch = re.search(r'#\sUser@Host:\s(.*)\n', line)
      if sqlmatch:
        self.__user = sqlmatch.group(1)
        break
      if line == '':
        break
      sqlline.append(line)
    sql = ' '.join(sqlline)

    self.row = {'user': self.__user, 'query_time': query_time, 'lock_time':lock_time, 'rows_sent':rows_sent,
                  'rows_examined':rows_examined, 'timestamp':timestamp, 'sql_text':sql.rstrip(';\n')}

      #if any value is missing, empty the dict
    for r in self.row:
      if self.row[r] == '':
        empty = True
      else:  empty = False

    if empty:  return 0
    # if empty:  self.row.clear()

    return 1

  def close(self):
    self.file.close()

  def stringFieldValueByName(self, name):
    return self.row[name]

########################################################################
##
##  Form class
##
##
########################################################################

class LogParamFrm(mforms.Form):

  def __init__(self):
    mforms.Form.__init__(self, None)
    self.logfile_path = ''
    self.sort_method = 'query_time'
    self.result = None

    self.set_title(&quot;Log Parameters&quot;)

    #bx -- first box as container for others
    bx = mforms.newBox(False)
    bx.set_padding(12)
    bx.set_spacing(12)
    self.set_content(bx)

    #bx components
    lbtitle = mforms.newLabel()
    lbtitle.set_text(&quot;Slow Query Log Analyze Options&quot;)
    self.rbfile = newRadioButton(1)
    self.rbfile.add_clicked_callback(lambda: self.set_box())
    self.rbfile.set_text(&quot;Analyze log file on disk (output=file)&quot;)
    self.rbfile.set_active(True)
    self.lbdetail = newLabel(&quot;Select an option to analyze a log file for the slow_log table:&quot;)
    self.lbdetail.set_enabled(True)
#    self.lbdetail.set_style(mforms.SmallStyle)
    self.rbtable = newRadioButton(1)
    self.rbtable.add_clicked_callback(lambda: self.set_box())
    self.rbtable.set_text(&quot;Analyze slow_log table (output=table)&quot;)
    bx.add(self.lbdetail, False, True)
    bx.add(self.rbfile, False, True)
    bx.add(self.rbtable, False, True)
    bx.add(lbtitle, False, True)

    #bxfile_path -- list path selection and radio buttons
    bxfile_path = newBox(True)
    bxfile_path.set_spacing(4)
    self.tbfile = newTextEntry()
    self.lbfile = newLabel(&quot;   File Path&quot;)
    self.btfile = newButton()
    self.btfile.set_text(&quot;...&quot;)
    self.btfile.enable_internal_padding(False)
    self.btfile.set_enabled(True)
    self.btfile.add_clicked_callback(self.open_file_chooser)

    bxfile_path.add(self.lbfile, False, False)
    bxfile_path.add(self.tbfile, True, True)
    bxfile_path.add(self.btfile, False, False)
    bx.add(bxfile_path, False, True)

    #bxOptions -- sorting and other obtions
    bxoptions = mforms.newBox(True)
    bxoptions.set_spacing(4)
    bx.add(bxoptions, False, True)
    lbsort = newLabel(&quot;  Sort&quot;)
    self.cbsort = newSelector()
    self.cbsort.set_size(150, -1)
    sort_items = (&quot;query_time&quot;, &quot;count&quot;, &quot;rows_sent&quot;,&quot;rows_examined&quot;, &quot;lock_time&quot;)
    for item in sort_items:
      self.cbsort.add_item(item)
    self.cbsort.add_changed_callback(lambda: self.get_sort_method())
    bxoptions.add(lbsort, False, False)
    bxoptions.add(self.cbsort, False, False)

    #bxOK --- last items on window
    bxOK = mforms.newBox(True)
    bx.add(bxOK, False, True)
    bxOK.set_spacing(4)
    self.ok = mforms.newButton()
    self.ok.set_text(&quot;OK&quot;)
    self.ok.set_enabled(False)
    bxOK.add_end(self.ok, False, False)
    cancel = mforms.newButton()
    cancel.set_text(&quot;Cancel&quot;)
    bxOK.add_end(cancel, False, True)

    self.set_size(400, 300)
    self.center()

    self.result = self.run_modal(self.ok, cancel)

#-------open_file_chooser method---------
  def open_file_chooser(self):
    filechooser = FileChooser(mforms.OpenFile)
    filechooser.set_directory(self.logfile_path)
    if filechooser.run_modal():
      self.logfile_path = filechooser.get_path()
#      self.tbfile.set_value(self.logfile_path)
      self.tbfile.set_value(self.logfile_path)
      if self.logfile_path != '':
        self.ok.set_enabled(True)

#-------file path box visibility toggle method------
  def set_box(self):
    if self.rbfile.get_active():
      self.tbfile.show(True)
      self.lbfile.show(True)
      self.btfile.show(True)
      self.ok.set_enabled(True)
      self.ok.set_enabled(False)
    else:
      self.ok.set_enabled(True)
      self.tbfile.show(False)
      self.lbfile.show(False)
      self.btfile.show(False)

#---------------------------------------------------------------------------
  def get_sort_method(self):
    self.sort_method = self.cbsort.get_string_value()

</pre></p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=197&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2010/09/29/mysql-workbench-plugin-mforms-example-and-slow-query-log-statistics/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-28-at-5-06-40-pm.png?w=300" medium="image">
			<media:title type="html">Screen shot 2010-09-28 at 5.06.40 PM</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL Workbench Plugin: Slow Query Log Statistics</title>
		<link>http://lstigile.wordpress.com/2010/09/15/mysql-workbench-plugin-slow-query-log-statistics/</link>
		<comments>http://lstigile.wordpress.com/2010/09/15/mysql-workbench-plugin-slow-query-log-statistics/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 14:09:04 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[MySQL Workbench]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Slow Query Log]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=147</guid>
		<description><![CDATA[This is my first attempt at creating a plugin for MySQL Workbench.  As a first step, I’ve created a plugin that summarizes the slow query log if it’s output to the slow_log table, which is an option available in MySQL version 5.1 or newer.  It’s similar to the mysqldumpslow perl script, except that it doesn’t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=147&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is my first attempt at creating a plugin for MySQL Workbench.  As a first step, I’ve created a plugin that summarizes the slow query log if it’s output to the slow_log table, which is an option available in MySQL version 5.1 or newer.  It’s similar to the mysqldumpslow perl script, except that it doesn’t require perl, which should be more convenient on Windows.  In my next update, the plugin will provide the same summary statistics for the slow query log file on disk.</p>
<p>While the slow query log reports query time, lock time, rows sent and rows examined for each query; it&#8217;s often useful to group and aggregate similar queries for analysis.  For example, here’s a sample of the plugin output, which is sorted by count, after just a few clicks on a drupal6 site:</p>
<p><a href="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-14-at-3-14-16-pm.png"><img class="alignnone size-full wp-image-172" title="Screen shot 2010-09-14 at 3.14.16 PM" src="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-14-at-3-14-16-pm.png" alt="" width="746" height="279" /></a></p>
<p>The plugin groups all similar statements by substituting “STRING” and “DIGIT” for SQL parameters.  It then lists the total count, average time, the slowest SQL statement (not parameterized), the slowest execution time, average rows sent, average rows examined and the average lock time.</p>
<p>With 5.1, microsecond logging is only supported for the slow query log if it is output to file on disk.  Nevertheless, you can still glean very useful information by sorting by “rows examined” and comparing it to the rows actually sent.  A high ratio of rows examined to rows sent may indicate improper indexing.  The following output is sorted by &#8220;rows examined&#8221;</p>
<div><a href="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-14-at-2-44-38-pm.png"><img class="size-full wp-image-170" title="Screen shot 2010-09-14 at 2.44.38 PM" src="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-14-at-2-44-38-pm.png" alt="" width="749" height="346" /></a></div>
<p>REQUIREMENTS<br />
MySQL 5.1<br />
Slow Query Log Enabled,  log-out=TABLE<br />
( http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html )</p>
<p>MySQL Workbench 5.2.27 or new version.  Prior versions had a bug related to the field name passed from the GRT.</p>
<p>CODE<br />
To install the plugin, click on &#8221;view source&#8221; and copy the contents into a file named slowquerystats_sort_grt.py on your local computer or <a href="http://ftp.mysql.com/pub/mysql/download/slowquerystats.zip">download the file</a> To install the plugin, select Scripting | Install Module | Script File from the main menu.  Select the new plugin file and click open.</p>
<p><pre class="brush: python; collapse: true; light: false; toolbar: true;">
# Slow Log Stats custom plugin
# Sept 9, 2010
# This plugin groups similar queries and sorts them based on selection
# Requirements: Log slow queries = ON, log_output = TABLE.   Workbench version 5.2.27 or higher
#
from wb import *
import grt
import re
import datetime
from operator import itemgetter

# define this Python module as a GRT module
ModuleInfo = DefineModule(name= &quot;SlowQueryStats&quot;, author= &quot;lstigile&quot;, version=&quot;0.1&quot;)

@ModuleInfo.plugin(&quot;slowtablestats_time&quot;, caption= &quot;Slow Query Table Stats by Time&quot;, input= [wbinputs.currentQueryBuffer()], pluginMenu= &quot;SQL/Utilities&quot;)
@ModuleInfo.export(grt.INT, grt.classes.db_query_QueryBuffer)
def executeSlowTableStatsTime(qbuffer):
  lines=[]
  editor= qbuffer.owner
  editor.addToOutput(&quot;\n&quot;, 1)
  sql = &quot;SELECT * FROM mysql.slow_log order by start_time desc limit 10000;&quot;

  resultsets= editor.executeScript(sql)

  tuples = parseSlowQueryTable(resultsets)
  tuples = sorted(tuples, key=itemgetter(2), reverse=True)

  lines = printFormat(tuples)

  editor.addToOutput(&quot;Slow Query Statistics By Time \n&quot;, 1)
  editor.addToOutput('\n'.join(lines), 0)
  return 0

@ModuleInfo.plugin(&quot;slowtablestats_rows_sent&quot;, caption= &quot;Slow Query Table Stats by Rows Sent&quot;, input= [wbinputs.currentQueryBuffer()], pluginMenu= &quot;SQL/Utilities&quot;)
@ModuleInfo.export(grt.INT, grt.classes.db_query_QueryBuffer)
def executeSlowTableStatsSent(qbuffer):
  lines=[]
  editor= qbuffer.owner
  editor.addToOutput(&quot;\n&quot;, 1)
  sql = &quot;SELECT * FROM mysql.slow_log order by start_time desc limit 10000;&quot;

  resultsets= editor.executeScript(sql)

  tuples = parseSlowQueryTable(resultsets)
  tuples = sorted(tuples, key=itemgetter(5), reverse=True)

  lines = printFormat(tuples)

  editor.addToOutput(&quot;Slow Query Statistics By Rows Sent \n&quot;, 1)
  editor.addToOutput('\n'.join(lines), 0)
  return 0

@ModuleInfo.plugin(&quot;slowtablestats_rows_examined&quot;, caption= &quot;Slow Query Table Stats by Rows Examined&quot;, input= [wbinputs.currentQueryBuffer()], pluginMenu= &quot;SQL/Utilities&quot;)
@ModuleInfo.export(grt.INT, grt.classes.db_query_QueryBuffer)
def executeSlowTableStatsExamined(qbuffer):
  lines=[]
  editor= qbuffer.owner
  editor.addToOutput(&quot;\n&quot;, 1)
  sql = &quot;SELECT * FROM mysql.slow_log order by start_time desc limit 10000;&quot;

  resultsets= editor.executeScript(sql)

  tuples = parseSlowQueryTable(resultsets)
  tuples = sorted(tuples, key=itemgetter(6), reverse=True)

  lines = printFormat(tuples)

  editor.addToOutput(&quot;Slow Query Statistics By Rows Examined \n&quot;, 1)
  editor.addToOutput('\n'.join(lines), 0)
  return 0

@ModuleInfo.plugin(&quot;slowtablestats_rows_locked&quot;, caption= &quot;Slow Query Table Stats by Rows Locked&quot;, input= [wbinputs.currentQueryBuffer()], pluginMenu= &quot;SQL/Utilities&quot;)
@ModuleInfo.export(grt.INT, grt.classes.db_query_QueryBuffer)
def executeSlowTableStatsLocked(qbuffer):
  lines=[]
  editor= qbuffer.owner
  editor.addToOutput(&quot;\n&quot;, 1)
  sql = &quot;SELECT * FROM mysql.slow_log order by start_time desc limit 10000;&quot;

  resultsets= editor.executeScript(sql)

  tuples = parseSlowQueryTable(resultsets)
  tuples = sorted(tuples, key=itemgetter(7), reverse=True)

  lines = printFormat(tuples)

  editor.addToOutput(&quot;Slow Query Statistics By Rows Locked \n&quot;, 1)
  editor.addToOutput('\n'.join(lines), 0)
  return 0

@ModuleInfo.plugin(&quot;slowtablestats_count&quot;, caption= &quot;Slow Query Table Stats by Count&quot;, input= [wbinputs.currentQueryBuffer()], pluginMenu= &quot;SQL/Utilities&quot;)
@ModuleInfo.export(grt.INT, grt.classes.db_query_QueryBuffer)
def executeSlowLogStatsCount(qbuffer):
  lines=[]
  editor= qbuffer.owner
  sql = &quot;SELECT * FROM mysql.slow_log order by start_time desc limit 10000;&quot;
  resultsets= editor.executeScript(sql)
  editor.addToOutput(&quot;\n&quot;, 1)
  tuples = parseSlowQueryTable(resultsets)
  tuples = sorted(tuples, key=itemgetter(1), reverse=True)

  lines = printFormat(tuples)

  editor.addToOutput(&quot;Slow Query Statistics By Count \n&quot;, 1)
  editor.addToOutput('\n'.join(lines), 0)
  return 0

#-----------------------------------
# format info to print to screen
#------------------------------------
def printFormat(tuples):
  lines=[]
  for item in tuples:
    (statement, count, avg, max_statement, max_time, rows_sent, rows_examined, lock_time) = item
    lines.append('Statement: ' + statement + '\n' + 'count: ' + str(count) + '\n' +
                        'average time:' +  str(avg) + '\n' +
                        'slowest sql: ' + max_statement + '\n' +
                        'slowest time: ' + str(max_time) + '\n'
                        'average rows sent: ' + str(rows_sent) + '\n'
                        'average rows examined: ' + str(rows_examined) + '\n'
                        'average lock time: ' + str(lock_time) + '\n\n'
                     )
  return lines

#----------------------------
def parseSlowQueryTable(resultsets):
  for result in resultsets:
    row_count = {}
    totaltime = {}
    maxtime = {}
    avgtime = {}
    maxstmt = {}
    totalrowssent = {}
    avgrowssent = {}
    totalrowsexamined = {}
    avgrowsexamined = {}
    totallocktime = {}
    avglocktime = {}
    lines= []

    ok = result.goToFirstRow()

    while ok:
      sql = result.stringFieldValueByName('sql_text')
      time = result.stringFieldValueByName('query_time')
      time = datetime.timedelta(hours=int(time[0:2]), minutes=int(time[3:5]),
        seconds=int(time[6:9]))
      timelock = result.stringFieldValueByName('lock_time')
      timelock = datetime.timedelta(hours=int(timelock[0:2]), minutes=int(timelock[3:5]),
        seconds=int(timelock[6:9]))
      sent = int(result.stringFieldValueByName('rows_sent'))
      examined = int(result.stringFieldValueByName('rows_examined'))

      #Use python regular expression engine to replace variables with STRING or
      #DIGIT  For readability, notes on expression are in comments at bottom of this
      #script.  Modify this expression if SQL statements are not correctly grouped.
      sql = re.sub(r'(?&lt;=[\s\(,&lt;&gt;=][\'\&quot;]).*?(?=[\'\&quot;]\)$|[\'\&quot;]$|[\'\&quot;][\,\)]\s|[\'\&quot;]\s[ORDER|GROUP|AND|WHERE])','STRING', sql)

      #  replace all digits with 'DIGIT'
      sql = re.sub(r'(?&lt;=[-+=\s\(,&lt;&gt;])\d.*?(?=[\s\),\)]|$)','DIGIT', sql)

      #determine if SQL is in row_count dict, if not add statement and count, else increment
      #existing entries
      if not sql in row_count:
        row_count[sql] = 1
        totaltime[sql] = time
        totallocktime[sql] = timelock
        totalrowssent[sql] = sent
        totalrowsexamined[sql] = examined
        maxtime[sql] = time
        maxstmt[sql] = result.stringFieldValueByName('sql_text')
      else:
        row_count[sql] = row_count[sql] + 1
        totaltime[sql] = totaltime[sql] + time
        totallocktime[sql] = totallocktime[sql] + timelock
        totalrowssent[sql] = totalrowssent[sql] + sent
        totalrowsexamined[sql] = totalrowsexamined[sql] + examined
        if maxtime[sql] &lt; time:
          maxtime[sql]=time
          maxstmt[sql] = result.stringFieldValueByName('sql_text')

      avgtime[sql] = totaltime[sql]/row_count[sql]
      avgrowssent[sql] = totalrowssent[sql]/row_count[sql]
      avgrowsexamined[sql] = totalrowsexamined[sql]/row_count[sql]
      avglocktime[sql] = totallocktime[sql]/row_count[sql]

      ok= result.nextRow()

    for row in row_count:
      lines.append((row,row_count[row],avgtime[row],maxstmt[row],maxtime[row],
        avgrowssent[row],avgrowsexamined[row],avglocktime[row]))

#  list = [tuple(item.split(&quot;,&quot;)) for item in lines]
    tuples = tuple(lines)

  return tuples

###explanation of regular expression
    #  &quot;?&lt;=&quot;  search for one of the following but don't include it in the returned value:
    #  &quot;[\s\\='\(&lt;&gt;]&quot;  a space, single quote, paren, greater than or less than
    #  &quot;[\'\&quot;])&quot; followed by a text deliminer of single or double quote
    #  &quot;.*?&quot;  return one or more words that match up to the next delimiter:
    #  &quot;(?=[\'\&quot;]$|[\'\&quot;][\s\)])&quot;  ?= means to not include the following filter in the return value
    #   search to the delimiter, but only stop if it's the end of the line or followed by a space
    #   or a paren.  This helps capture strings with a single-quote embedded within
</pre></p>
<p>RUN THE PLUGIN<br />
To run the plugin, you&#8217;ll need to open the SQL Editor.  For now, only the SQL Editor enables the plugin menu.  To open the Editor, from the Workbench home page, select the option to &#8220;open Connection to Start Querying&#8221; or by selecting Database | Query Database from the main menu.</p>
<p>Once you&#8217;re in the SQL Editor, you should see the plugins under Plugins | Utilities</p>
<div id="attachment_164" class="wp-caption alignnone" style="width: 384px"><a href="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-13-at-5-15-17-pm.png"><img class="size-full wp-image-164 " title="Screen shot 2010-09-13 at 5.15.17 PM" src="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-13-at-5-15-17-pm.png" alt="" width="374" height="161" /></a><p class="wp-caption-text">New Plugins Available From Menu</p></div>
<p>If you select one of the options and don&#8217;t see any results in the output screen, it&#8217;s likely that you haven&#8217;t output the slow query log to the slow_log table in the mysql database.  In order to run this plugin, you should see results when you execute &#8220;SELECT * FROM mysql.slow_log limit 5&#8243;<br />
A few notes for other folks interested in developing plugins:<br />
I found it much easier to develop the entire script in Python and then to convert it to a plugin.  In case it helps, the following includes my independent Python code:</p>
<p>mysqlexec.py</p>
<p><pre class="brush: python; collapse: true; light: false; toolbar: true;">
import sys
import MySQLdb

def myexec(sql):
  my_host = &quot;hostIP&quot;
  my_user = &quot;user&quot;
  my_pass = &quot;pwd&quot;
  my_db = &quot;mysql&quot;

  try:
    db = MySQLdb.connect(host=my_host, user=my_user, passwd=my_pass, db=my_db)
  except MySQLdb.Error, e:
    print &quot;Error %d: %s&quot; % (e.args[0], e.args[1])
    sys.exit (1)

  cursor = db.cursor()
#  print &quot;in func line 17&quot;
  cursor.execute(sql)
  resultset = cursor.fetchall()

  db.close()

  return resultset
</pre></p>
<p>slowquery.py</p>
<p><pre class="brush: python; collapse: true; light: false; toolbar: true;">
import mysqlexec
import re
import datetime
from operator import itemgetter

def slowlogstats(sql):
###def slowlogstats(qbuffer):
 ## editor= qbuffer.owner
 ## sql= qbuffer.selectedText or qbuffer.script
##  resultsets= editor.executeScript(sql)
###  editor.addToOutput(&quot;\n&quot;, 1)

  try:
    resultsets = mysqlexec.myexec(sql)
  except Exception, e:
    raise Exception(&quot;Error fetching log contents: %s&quot; % e)

  row_count = {}
  totaltime = {}
  maxtime = {}
  maxstmt = {}
  avgtime = {}
  lines = []

  for result in resultsets:
    sql= result[0]
    time = result[1]

    ###explanation of regular expression
    #  &quot;?&lt;=&quot;  search for one of the following but don't include it in the returned value:
    #  &quot;[\s\\='\(&lt;&gt;]&quot;  a space, single quote, paren, greater than or less than
    #  &quot;[\'\&quot;])&quot; followed by a text deliminer of single or double quote
    #  &quot;.*?&quot;  return one or more words that match up to the next delimiter:
    #  &quot;(?=[\'\&quot;]$|[\'\&quot;][\s\)])&quot;  ?= means to not include the following filter in the return value
    #               search to the delimiter, but only stop if it's the end of the line or followed by a space
    #               or a paren.  This helps capture strings with a single-quote embedded within
#    sql = re.sub(r'(?&lt;=[\s\'\&quot;\(,&lt;&gt;=][\'\&quot;]).*?(?=[\'\&quot;]$|[\'\&quot;][\s\),\)])','STRING', sql)
    sql = re.sub(r'(?&lt;=[\s\(,&lt;&gt;=][\'\&quot;]).*?(?=[\'\&quot;]\)$|[\'\&quot;]$|[\'\&quot;][\,\)]\s|[\'\&quot;]\s[ORDER|GROUP|AND|WHERE])','STRING', sql)
      #  replace all digits with 'DIGIT'
    sql = re.sub(r'(?&lt;=[-+=\s\(,&lt;&gt;])\d.*?(?=[\s\),\)]|$)','DIGIT', sql)

    if not sql in row_count:
      row_count[sql] = 1
      totaltime[sql] = time
      maxtime[sql] = time
      maxstmt[sql] = result[0]
    else:
      row_count[sql] = row_count[sql] + 1
      totaltime[sql] = totaltime[sql] + time
      if maxtime[sql] &lt; time:
        maxtime[sql]=time
        maxstmt[sql] = result[0]

    avgtime[sql] = totaltime[sql]/row_count[sql]

  #sorted_sql = sorted(row_count, key=row_count.get, reverse=True)
  #sorted_sql = sorted(avgtime, key=avgtime.get, reverse=True)

  for row in row_count:
    lines.append((row,row_count[row],avgtime[row],maxstmt[row],maxtime[row]))

#  list = [tuple(item.split(&quot;,&quot;)) for item in lines]
  tuples = tuple(lines)

  return tuples

def main():
  lines=[]
  tuples = slowlogstats(&quot;SELECT sql_text, query_time FROM mysql.slow_log order by query_time DESC limit 5&quot;)

  tuples = sorted(tuples, key=itemgetter(1), reverse=True)
  for item in tuples:
    (statement, count, avg, max_statement, max_time) = item
    lines.append('Statement: ' + statement + '\n' + 'count: ' + str(count) + '\n' +
                        'average time:' +  str(avg) + '\n' +
                        'slowest sql: ' + max_statement + '\n' + 'slowest time: ' +
                        str(max_time) + '\n\n')
  print lines

if __name__ == '__main__':
  main()
</pre></p>
<p>Also, I borrowed heavily from existing plugins and modules including the plugin to execute a query to vertical text:  <a title="MySQL Workbench Plugin: Execute Query to Text Output" href="http://wb.mysql.com/?p=677">http://wb.mysql.com/?p=677</a></p>
<p>Note: I&#8217;m new to Python, so I&#8217;d gladly accept any criticism regarding the script itself.</p>
<p>I hope someone finds this useful or is at least inspired to build their own plugin.  I look forward to posting my next version to include a summary of the slow query log files on disk.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/147/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=147&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2010/09/15/mysql-workbench-plugin-slow-query-log-statistics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-14-at-3-14-16-pm.png" medium="image">
			<media:title type="html">Screen shot 2010-09-14 at 3.14.16 PM</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-14-at-2-44-38-pm.png" medium="image">
			<media:title type="html">Screen shot 2010-09-14 at 2.44.38 PM</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2010/09/screen-shot-2010-09-13-at-5-15-17-pm.png" medium="image">
			<media:title type="html">Screen shot 2010-09-13 at 5.15.17 PM</media:title>
		</media:content>
	</item>
		<item>
		<title>Sure-fire MySQL Install on Windows</title>
		<link>http://lstigile.wordpress.com/2010/06/24/sure-fire-mysql-install-on-windows/</link>
		<comments>http://lstigile.wordpress.com/2010/06/24/sure-fire-mysql-install-on-windows/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 22:07:27 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[MySQL Install]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[Windows Install]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=123</guid>
		<description><![CDATA[Due to firewalls, virus scans, corporate security restrictions, or just plain bad luck; there are times when MySQL just won&#8217;t install on a specific Windows server.  Here&#8217;s a sure-fire install method.   Relax, I won&#8217;t have you run the msi installer again. The first step is to remove directories from your previous install attempts.  Uninstall [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=123&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Due to firewalls, virus scans, corporate security restrictions, or just plain bad luck; there are times when MySQL just won&#8217;t install on a specific Windows server.  Here&#8217;s a sure-fire install method.   Relax, I won&#8217;t have you run the msi installer again.</p>
<p>The first step is to remove directories from your previous install attempts.  Uninstall from the control panel.  Manually, rename or delete &#8220;C:\Program Files\MySQL\MySQL Server 5.1&#8243;.  Next, delete (or rename) the data directory.  Warning! If you have previously entered data into MySQL, deleting the data directory will delete data.  The directory is located at &#8220;C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data&#8221;.   You may need to <a href="http://support.microsoft.com/kb/68544" target="_blank">unhide</a> the data directory.</p>
<p>Let&#8217;s get started.</p>
<p>#1.  <a href="http://dev.mysql.com/downloads/mysql/#downloads" target="_blank">Download</a> the no-install MySQL Version for Windows.  Choose either &#8220;Windows (x86, 32-bit) ZIP Archive&#8221; or &#8220;Windows (x86, 64-bit) ZIP Archive&#8221; based on whether your system is <a href="http://support.microsoft.com/kb/827218" target="_blank">64 or 32-bit</a> .</p>
<p>#2.  Unzip the files to &#8220;C:\Program Files\MySQL\MySQL Server 5.1&#8243;.</p>
<p>#3.  Use notepad or wordpad to create a my.ini file and save the file in the MySQL directory, &#8220;C:\Program Files\MySQL\MySQL Server 5.1&#8243;   Be careful that notepad doesn&#8217;t add a default &#8220;.txt&#8221; extension to the my.ini file ( <a href="http://support.microsoft.com/kb/253688" target="_blank">http://support.microsoft.com/kb/253688</a> )</p>
<p>Add the following following to your my.ini file and save.</p>
<p><pre class="brush: plain;">
[mysqld]
##update basedir if you move the install location
basedir=&quot;C:/Program Files/MySQL/MySQL Server 5.1&quot;

##update datadir if you move the data directory
datadir=&quot;C:/Program Files/MySQL/MySQL Server 5.1/data&quot;

## increase to 40% of RAM if using MyISAM
key_buffer_size=32MB

## increase to 80% of available RAM for production usage
innodb_buffer_pool_size = 128MB

## may want to increase if write intensive
innodb_log_file_size = 64MB
innodb_log_buffer_size=8MB
table_cache=1024
thread_cache=16
query_cache_size=32M
</pre></p>
<p>Note the basedir and the datadir variables.  If you wish to install in a different location or put the data in a different location, update these values accordingly.</p>
<p>#3.  Create and start the service.    Open a command prompt, and enter the following:</p>
<p><pre class="brush: plain;">
&quot;C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld&quot;  --install &quot;MySQL 5.1&quot; --defaults-file=&quot;C:\Program Files\MySQL\MySQL Server 5.1\my.ini&quot;
</pre></p>
<p>This installs the server.  To start the service, type</p>
<p><pre class="brush: plain;">
net start &quot;MySQL 5.1&quot;
</pre></p>
<p>or start the service from the control panel.</p>
<p>You should be up and running.  If not, check your err log in &#8220;C:\Program Files\MySQL\MySQL Server 5.1\Data&#8221;</p>
<p>#4.  Connect from your client application and update your user accounts.  By default, there are 3 accounts: root@localhost, root@127.0.0.1 and an anonymous account.</p>
<p>The following commands log in with the mysql command-line client, remove the anonymous account and set the password for the root accounts.</p>
<p>At a command prompt, enter the following:</p>
<p><pre class="brush: plain;">
&quot;c:\program files\mysql\mysql 5.1 server\bin\mysql&quot; -uroot
</pre></p>
<p>This will log you into MySQL and you should have a mysql command prompt like mysql&gt;</p>
<p>Here are the commands to delete your anonymous account and set passwords for your two root accounts.  When setting the password, substitute your desired password for &#8220;mypassword&#8221;.</p>
<p><pre class="brush: plain;">

mysql&gt; DROP USER &quot;&quot;@localhost;
mysql&gt; Set PASSWORD FOR &quot;root&quot;@&quot;localhost&quot; = password(&quot;mypassword&quot;);
mysql&gt; Set PASSWORD FOR &quot;root&quot;@&quot;127.0.0.1&quot; = password(&quot;mypassword&quot;);
mysql&gt; flush privileges;
mysql&gt; exit
</pre></p>
<p>Feel free to post any questions/comments or issues to the comment section of this blog.  For more comprehensive instructions see http://dev.mysql.com/doc/refman/5.1/en/windows-install-archive.html</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=123&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2010/06/24/sure-fire-mysql-install-on-windows/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>
	</item>
		<item>
		<title>Enable MySQL Enterprise Plugin for Connector/NET</title>
		<link>http://lstigile.wordpress.com/2010/06/14/enable-mysql-enterprise-plugin-for-connectornet/</link>
		<comments>http://lstigile.wordpress.com/2010/06/14/enable-mysql-enterprise-plugin-for-connectornet/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 20:10:03 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[Enterprise Monitor]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Connector/NET]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[MySQL Enterprise Monitor]]></category>
		<category><![CDATA[Query Analyzer]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=106</guid>
		<description><![CDATA[In a prior post ( Trace SQL From Database to Source Code ), I showed how to enable SQL trace capabilities for java/MySQL application to trace SQL statements from the database to the exact line of code from which the statement was executed (see Figure 1).  In this post, I&#8217;ll enable SQL tracing in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=106&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_91" class="wp-caption alignright" style="width: 147px"><a href="http://lstigile.files.wordpress.com/2010/06/screen-shot-2010-06-10-at-3-00-37-pm2.png"><img class="size-thumbnail wp-image-91 " title="Screen shot 2010-06-10 at 3.00.37 PM" src="http://lstigile.files.wordpress.com/2010/06/screen-shot-2010-06-10-at-3-00-37-pm2.png?w=137&#038;h=150" alt="" width="137" height="150" /></a><p class="wp-caption-text">Figure 1.  Source Location</p></div>
<p>In a prior post ( <a href="http://lstigile.wordpress.com/2010/06/11/trace-sql-from-the-database-to-the-s&lt;/a&gt;ource-code-with-mysql-enterprise-monitor/"> Trace SQL From Database to Source Code </a> ), I showed how to enable SQL trace capabilities for java/MySQL application to trace SQL statements from the database to the exact line of code from which the statement was executed (see Figure 1).  In this post, I&#8217;ll enable SQL tracing in the sample C# application, which is included with the MySQL Connector/NET (MySQL&#8217;s ADO.NET provider ) install.</p>
<p>The following instructions assume that the MySQL Enterprise Agent and Monitor is already installed.  The Monitor is available for support customers at http://customer.mysql.com or a trial is available at http://www.mysql.com/trials .</p>
<p>Step #1.  Download and install the Connector/NET and the MySQL Enterprise Plugin for Connector/NET</p>
<ul>
<li> <a href="http://dev.mysql.com/downloads/connector/net"> Connector/NET 6.2.3 or newer version. </a>The assembly is MySQL.Data.dll  Select the option to install the C# samples.</li>
<li>MySQL Enterprise Plugin for Connnector/NET ( http://customer.mysql.com or www.mysql.com/trials ).  The assembly is MySQL.MonitorPlugin.dll</li>
</ul>
<p>Step #2.  Copy the plugin, MySQL.MonitorPlugin.dll to your application directory.  In my case, I&#8217;m building and debugging the sample application using Microsoft Visual C# 2008 Express Edition.  The MySQL.MonitorPlugin.dll needs to reside in the same directly as the application&#8217;s executable.  Copy the dll to C:\Program Files\MySQL\MySQL Connector Net 6.2.3\Samples\Table Editor\cs\bin\Debug</p>
<p>Step #3.  Open the sample project TableEditor.csproj ( C:\Program Files\MySQL\MySQL Connector Net 6.2.3\Samples\Table Editor\cs\TableEditor.csproj ) in Microsoft Visual Studio and add an App.config file to the project.  For this exercise, I&#8217;m using Microsoft Visual C# 2008 Express Edition.</p>
<p>To add the App.config file, select <strong>Solution Explorer</strong> on the <strong>View</strong> menu, right-click on <strong>TableEditor</strong>, the project name.  Point to <strong>Add</strong>, <strong>New Item</strong>, and choose <strong>Application Configuration File</strong>.</p>
<p>In <strong>Solution Explorer</strong>, double-click <strong>App.config</strong> to open the file.  Replace the contents of the file with the XML below.  <strong>Note: </strong>replace the items in brackets [ ] with the appropriate information for your server.  (Omit the brackets)  Likewise, the UserID and Password should match the credentials that the agent uses to authenticate to the Monitor.</p>
<p>Copy and paste the following into App.config:</p>
<p><pre class="brush: xml;">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;configuration&gt;
  &lt;system.diagnostics&gt;
    &lt;sources&gt;
      &lt;source name=&quot;mysql&quot; switchName=&quot;SourceSwitch&quot;    switchType=&quot;System.Diagnostics.SourceSwitch&quot;&gt;
        &lt;listeners&gt;
          &lt;add name=&quot;EMTrace&quot; type=&quot;MySql.EMTrace.EMTraceListener, MySql.MonitorPlugin&quot;
                    initializeData=&quot;&quot;
            Host=&quot;[http://yourServer.com:18080]&quot;
            PostInterval=&quot;60&quot;
            UserId=&quot;[agent]&quot;
            Password=&quot;[mysql]&quot;/&gt;
          &lt;/listeners&gt;
      &lt;/source&gt;
    &lt;/sources&gt;
    &lt;switches&gt;
      &lt;!-- You can set the level at which tracing is to occur --&gt;
      &lt;add name=&quot;SourceSwitch&quot; value=&quot;All&quot;/&gt;
    &lt;/switches&gt;
  &lt;/system.diagnostics&gt;
&lt;/configuration&gt;</pre></p>
<p>[Note: if you're following the readme or documentation, you'll notice that I omitted the &lt;system.data&gt; section.  I believe this to be an error in the documentation.  In my testing, it never works with the &lt;system.data&gt; entry.]</p>
<p>Step #4.  Modify the connection string to include &#8220;logging = true&#8221;</p>
<p>Here&#8217;s the full connection string that I used while running the sample application:</p>
<p>string connStr = String.Format(&#8220;server={0};user id={1}; password={2}; database=mysql; port=3307; pooling=false; logging=true&#8221;,server.Text, userid.Text, password.Text );</p>
<p>Step #5.  Compile the application ( <strong>Debugging</strong> | <strong>Start Debugging (F5) </strong>).   On <strong>Form1</strong>, enter the appropriate Server, User ID and Password for the MySQL Server and toggle the databases and tables.  Watch the <strong>Output</strong> window, select <strong>Output</strong> from the <strong>View</strong> menu in the IDE, and you should start seeing SQL debug information, which will be passed to the MySQL Enterprise Monitor.  In the App.config, the PostInterval is set to 30, meaning that it will take 30 seconds before the data is sent to the monitor.</p>
<p>If you&#8217;re a .NET developer, please give it a try.  The query analyzer provides a great view into your application and the database.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/106/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=106&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2010/06/14/enable-mysql-enterprise-plugin-for-connectornet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2010/06/screen-shot-2010-06-10-at-3-00-37-pm2.png?w=137" medium="image">
			<media:title type="html">Screen shot 2010-06-10 at 3.00.37 PM</media:title>
		</media:content>
	</item>
		<item>
		<title>Trace SQL From the Database to the Source Code with MySQL Enterprise Monitor</title>
		<link>http://lstigile.wordpress.com/2010/06/11/trace-sql-from-the-database-to-the-source-code-with-mysql-enterprise-monitor/</link>
		<comments>http://lstigile.wordpress.com/2010/06/11/trace-sql-from-the-database-to-the-source-code-with-mysql-enterprise-monitor/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 16:10:19 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[Enterprise Monitor]]></category>
		<category><![CDATA[Connector Plugin]]></category>
		<category><![CDATA[Connector/J]]></category>
		<category><![CDATA[enterprise monitor]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=79</guid>
		<description><![CDATA[OK, you found the problem SQL statement that was affecting your server’s performance, now where did it originate? The new MySQL Enterprise Plugins for Connector/J and Connector/NET send query statistics, including the source location for each query, directly to the MySQL Enterprise Monitor. Figure 1 is a screenshot of new source location feature. Figure 2 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=79&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">OK, you found the problem SQL statement that was affecting your server’s performance, now where did it originate?</span></p>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">The new MySQL Enterprise Plugins for Connector/J and Connector/NET send query statistics, including the source location for each query, directly to the MySQL Enterprise Monitor.</span></p>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">Figure 1 is a screenshot of new source location feature.</span></p>
<div id="attachment_81" class="wp-caption alignnone" style="width: 514px"><a href="http://lstigile.files.wordpress.com/2010/06/screen-shot-2010-06-10-at-3-00-37-pm2.png"><img class="alignnone size-full wp-image-91" title="Screen shot 2010-06-10 at 3.00.37 PM" src="http://lstigile.files.wordpress.com/2010/06/screen-shot-2010-06-10-at-3-00-37-pm2.png" alt="" width="504" height="550" /></a><p class="wp-caption-text">Figure 1.  Source Location</p></div>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">Figure 2 shows the standard query statistics, which are collected in the query analyzer.  In both cases, the statistics are gathered by the MySQL Connector and the Plugin, not MySQL proxy.</span></p>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;"> </span></p>
<div id="attachment_82" class="wp-caption alignnone" style="width: 795px"><a href="http://lstigile.files.wordpress.com/2010/06/screen-shot-2010-06-10-at-2-23-35-pm1.png"><img class="alignnone size-full wp-image-92" title="Screen shot 2010-06-10 at 2.23.35 PM" src="http://lstigile.files.wordpress.com/2010/06/screen-shot-2010-06-10-at-2-23-35-pm1.png" alt="" width="785" height="235" /></a><p class="wp-caption-text">Figure 2.  Query Analyzer</p></div>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">If you’re a MySQL Enterprise customer, you can download the new monitor and plugins from customer.mysql.com.  If you’d like to try it out, a 30 day trial is available at <a href="http://www.mysql.com/trials/">http://www.mysql.com/trials/</a></span></p>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">Please review the help file and readme for full instructions, but here are a few of the highlights for setting up monitoring for Java applications.  (I’ll provide further instructions for .NET in a future post.)</span></p>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">1.  Set up the MySQL Enterprise Monitor and Agent.  The agent resides on the MySQL production server and the monitor should reside on a non-production server within your environment.  Although the Plugin gathers the query statistics, the agent needs to run and connect to the monitor at least once so the Monitor can associate the data with the appropriate server.</span></p>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">2.  Download the following files from the customer portal (customer.mysql.com) and add them to your classpath:</span></p>
<ul>
<li>Connector/J version 5.1.12 or newer</li>
</ul>
<ul>
<li>Plugin for Connector/J c-java-mysql-enterprise-plugin-1.0.0.42.jar</li>
</ul>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">3.  Change your JDBC url.  In my case, I changed it from the standard JDBC url, “jdbc:mysql:127.0.0.1:3306/sakila , to</span></p>
<p style="padding-left:30px;">&#8220;jdbc:mysql://127.0.0.1:3306/sakila?statementInterceptors=com.mysql.etools.jdbc.StatementPerformanceCounters&amp; amp;serviceManagerUrl=http://[mymonitorURL.com]&amp;serviceManagerUser=[myagentusername]&amp; serviceManagerPassword=[myagentpassword]l&#8221;;</p>
<p style="padding-left:30px;"><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">Full instructions are in the readme.  Substitute appropriate URL and credentials for the bracketed [ ] items above.</span></p>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;"><br />
4.  Finally, the mysql user account that is used by the application needs to have SELECT privilege to the mysql.inventory table.  This table includes a unique identifier which the monitor uses to match the data with the MySQL instance.  I executed the following:</span></p>
<p style="padding-left:30px;">mysql&gt; GRANT SELECT ON mysql.inventory TO &#8216;elgato&#8217;@'%&#8217;;</p>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">I found it helpful to monitor the application log file for error messages.   The readme includes additional logging information.  In my tomcat test application, the log information was sent to /var/logs/tomcat6/daemon.log file.</span></p>
<p><span style="font-family:Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:medium;">I hope this is helpful information.  If you have any issues, feel free to post a comment on this blog post or post on the forums:  <a href="http://forums.mysql.com/list.php?166">http://forums.mysql.com/list.php?166</a></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=79&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2010/06/11/trace-sql-from-the-database-to-the-source-code-with-mysql-enterprise-monitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2010/06/screen-shot-2010-06-10-at-3-00-37-pm2.png" medium="image">
			<media:title type="html">Screen shot 2010-06-10 at 3.00.37 PM</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2010/06/screen-shot-2010-06-10-at-2-23-35-pm1.png" medium="image">
			<media:title type="html">Screen shot 2010-06-10 at 2.23.35 PM</media:title>
		</media:content>
	</item>
		<item>
		<title>Launch MySQL from the Command Line</title>
		<link>http://lstigile.wordpress.com/2009/12/02/64/</link>
		<comments>http://lstigile.wordpress.com/2009/12/02/64/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 22:49:16 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[MySQL Install]]></category>
		<category><![CDATA[MySQL install oem deploy]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=64</guid>
		<description><![CDATA[In my last blog entry, I discussed a &#8220;silent&#8221; install method for deploying MySQL on Windows.  However, the best way to distribute MySQL may be to not install it.  Instead, design the application to launch mysql from the command line.  With this method, you can deploy with two files, avoid registry entries, and hide database [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=64&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my last blog entry, I discussed a &#8220;silent&#8221; install method for deploying MySQL on Windows.  However, the best way to distribute MySQL may be to not install it.  Instead, design the application to launch mysql from the command line.  With this method, you can deploy with two files, avoid registry entries, and hide database files from end-users and their IT staff.</p>
<p>[Note:  these instructions may also be useful if you can't get the MySQL installer to run on a particular Windows machine.  I find it easier to copy the system tables from an existing install of MySQL that was deployed with the Windows MSI installer.  Nevertheless, you could download the "without installer" MySQL zip file and use the mysql_system_tables.sql and mysql_system_table_data.sql to create your system tables.  I had to remove the "WHERE @had_user_table=0" from the mysql_system_table_data.sql to get it to work.  The SC.exe tool can be used to add it to the services]</p>
<p>The following is a minimum install example.  I prefer to run the full install using the Windows Essentials or the Windows MSI Installer download from http://dev.mysql.com/downloads/mysql/5.1.html#win32 .  Stop the service and use the files that were generated from the install to set up MySQL on your target machine.</p>
<p>Step 1.  Create an empty directory on the target server.  I created c:\min.  From an existing MySQL install, copy the following files into c:\min:</p>
<p>mysqld.exe</p>
<p>errmsg.sys</p>
<p>In my unmodified 5.1 version, mysqld.exe is 8.2 MB and errmsg.sys is 36K.  The following command will launch the full version of the server with only the aforementioned files:</p>
<p>Step 2.  c:\min&gt;mysqld.exe <code>--language=. --datadir=. --skip-grant-tables --bind-address=localhost<br />
</code><br />
That&#8217;s it.  MySQL is running and you can now connect and create tables.</p>
<p>I used the following server options:<br />
<code><br />
--language=. </code>This is an essential parameter.  Your install needs to find errmsg.sys to start.  I retrieved this file from the &#8220;share&#8221; folder in an existing installation.</p>
<p><code>--datadir=. </code> This determines the location of the data directory.  In my simple example, I put the data files in the application directory.  You may prefer to specify a data directory in the recommended Windows application directory.</p>
<p><code>--skip-grant-tables</code> This variable allows MySQL to load without the privileges table.  Anyone can connect without authenticating.   I&#8217;ve specified <code>--bind-address</code> for only local connections. If you&#8217;re deploying to a server in a secure location on a private network and MySQL is only running when your application is running, this may be acceptable.</p>
<p><code>--bind-address</code>=localhost  This option determines the IP address for which to bind, it will only listen on localhost.  As an alternative, it&#8217;s possible to run MySQL on windows with named pipes or shared memory.</p>
<p>To force authentication, you will need to include the privilege tables.  In this case, create a data directory.  In my case I used c:\min\data .  Then, copy the mysql folder from an existing install into the data directory.  Then, start MySQL and specify the new data directory:</p>
<p>c:\min&gt;mysqld.exe <code>--language=. --datadir=./data<br />
</code><br />
Since these are MyISAM files, MySQL will recognize the additional database and files.  Also, omit the <code>--skip-grant-tables</code> parameter.  Now, you&#8217;ll be prompted for a password.  It will be the same password that you specified when you ran the full install.</p>
<p>MySQL is running.  What&#8217;s next?  If you&#8217;re deploying an application, you&#8217;ll need to deploy your initial schema and data.  The simplest way would be to dump the schema and tables from your development machine and then load in the sql script on your target server.  Documentation for dumping a loading and database can be found here: http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html</p>
<p>There are many startup options and system variables which can be specified on the command line or the configuration file (<code>--defaults-file</code>).</p>
<p>Here are the appropriate links:</p>
<p>http://dev.mysql.com/doc/refman/5.1/en/server-options.html</p>
<p>http://dev.mysql.com/doc/refman/5.1/en/using-system-variables.html</p>
<p>If only using MyISAM, you might want to start MySQL with <code>--skip-innodb</code>.  You can use these options to make your installation more secure. You may want to change the default TCP/IP port.  If using InnoDB, you can set innodb-data-file-path to a different location, a more obscure filename and a different size.  This would prevent someone from copying the data to another computer and trying to access the data with a different application.</p>
<p>There are other ways to deploy MySQL with your application, including using the &#8220;silent&#8221; install method or using the deeply embedded library (libmysqld).  If you&#8217;d prefer that your customer has full visibility and access to MySQL, a &#8220;silent&#8221; install adds MySQL to the program files, service control panel and the Add/Remove program options.  If you&#8217;re developing a stand-alone application in C/C++, the deeply embedded library (libmysqld) provides excellent performance with a small footprint. Otherwise, your best option may be to  launch MySQL from the command line.  This method provides a simple and lightweight deployment with all the MySQL server capabilities.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=64&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2009/12/02/64/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>
	</item>
		<item>
		<title>Silent Install Instructions</title>
		<link>http://lstigile.wordpress.com/2009/11/02/silent-install-instructions/</link>
		<comments>http://lstigile.wordpress.com/2009/11/02/silent-install-instructions/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 22:50:38 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[OEM]]></category>
		<category><![CDATA[silent install]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=61</guid>
		<description><![CDATA[This entry provides instructions for &#8220;silently&#8221; installing MySQL on a Microsoft Windows server.  I use the term &#8220;silent install&#8221; to describe the method of passing parameters to the Microsoft Installation Package (MSI) to bypass installation screens.  This allows you to deploy MySQL with your application and to install MySQL without end-user intervention.  The developer can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=61&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This entry provides instructions for &#8220;silently&#8221; installing MySQL on a Microsoft Windows server.  I use the term &#8220;silent install&#8221; to describe the method of passing parameters to the Microsoft Installation Package (MSI) to bypass installation screens.  This allows you to deploy MySQL with your application and to install MySQL without end-user intervention.  The developer can define the install location, the appropriate storage engines, the root password and the server configuration.</p>
<p>Most application developers use some sort of software for creating an application installer.  Common tools include Install Shield, Wise Installation, InstallBuilder and Windows Installer.  These installation software tools can also be used to install MySQL by launching the MySQL MSI and the MySQL Instance configuration utility ( MySQLInstanceConfig.exe ) from the command-line.</p>
<p>To get started, download the Windows Essentials from http://dev.mysql.com/downloads.</p>
<p>Then, look for an option in your installation tool to execute the following:</p>
<p>C:\&gt;msiexec /q /log install.txt /i mysql-advanced-5.1.32-win32.msi datadir=”c:\installs\myapp” installdir=”c:\installs\myapp”</p>
<p>The MSI installer will add MySQL to the start menu, add registry values and add MySQL to the add/remove programs option from the control panel.</p>
<p>To configure the server, prepare the my.ini, set the root password and start the service, you&#8217;ll need to execute the following:</p>
<p>C:\&gt;MySQLInstanceConfig.exe -i -q “-lC:\mysql_install_log.txt” “-nMySQL Server 5.1.234” -pC:\installs\myapp”   -v5.1.234  “tc:\installs\myapp\my-small.ini” “-cC:\mytest.ini ServerType=DEVELOPMENT DatabaseType=MIXED ConnectionUsage=DSS Port=3311 ServiceName=MySQLCust RootPassword=1234</p>
<p>This installation method has the benefit of adding MySQL to the control panel and the startup menus.  It also installs the default mysql tables.  The only remaining task is to import your application tables into MySQL by running mysqldump ( http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html ) on your development server and then loading the dump files into the target server.</p>
<p>In a future blog entry, I&#8217;ll discuss launching the mysqld.exe directly without actually installing MySQL.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=61&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2009/11/02/silent-install-instructions/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL Windows Password Reset</title>
		<link>http://lstigile.wordpress.com/2009/06/17/mysql-windows-password-reset/</link>
		<comments>http://lstigile.wordpress.com/2009/06/17/mysql-windows-password-reset/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 20:14:20 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=58</guid>
		<description><![CDATA[If you receive a 1045 error, you may need to reset your password.  Here are the official instructions for resetting the password: http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html If you find these instructions confusing, here&#8217;s another method.   1.  Find the my.ini file (my.cnf for linux).  On windows, the my.ini file is typically in your install directory: c:\Program Files\MySQL\MySQL Server [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=58&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you receive a 1045 error, you may need to reset your password.  Here are the official instructions for resetting the password: http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html</p>
<p>If you find these instructions confusing, here&#8217;s another method.  </p>
<p>1.  Find the my.ini file (my.cnf for linux).  On windows, the my.ini file is typically in your install directory: c:\Program Files\MySQL\MySQL Server 5.1\my.ini   Open the file with notepad (or any text editor) and add the following entry under the [mysqld] section:</p>
<p>skip-grant-tables</p>
<p>Then, save the file and restart the MySQL service.  This has disabled the grant tables so you should be able to log into mysql without any password ( no more 1045 errors ).  Now, we need to reset the password.  </p>
<p>2.  Log into MySQL with the MySQL command-line utility.  This can be found in the MySQL bin directory.  No user or password parameters are required since grant tables have been disabled.  Execute the following statement:</p>
<p>UPDATE mysql.user SET PASSWORD = PASSWORD(&#8221;) WHERE user = &#8216;root&#8217; and host=&#8217;localhost&#8217;;</p>
<p>This example will replace the root password with an empty string or no password.  Feel free to substitute the appropriate password in the PASSWORD(&#8221;) function or leave it blank and change the password later.</p>
<p>3.  Remove &#8220;skip-grant-tables&#8217; from the my.ini file and restart the MySQL service.</p>
<p>4.  Log into mysql.  Example: shell&gt;mysql -u root</p>
<p>I hope this helps.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=58&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2009/06/17/mysql-windows-password-reset/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL Windows Install Troubleshooting</title>
		<link>http://lstigile.wordpress.com/2009/06/15/mysql-windows-install-troubleshooting/</link>
		<comments>http://lstigile.wordpress.com/2009/06/15/mysql-windows-install-troubleshooting/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 21:04:55 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[1045 error]]></category>
		<category><![CDATA[error 0]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=39</guid>
		<description><![CDATA[If you&#8217;re having trouble installing MySQL 5.1 on a Windows server, I&#8217;d recommend the following process.  Don&#8217;t skip the first steps that describe the uninstall and removal of the previous install as this seems to clear up most issues.   For the uninstall, I&#8217;d recommend manually deleting data files.  Caution: deleting the data files will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=39&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re having trouble installing MySQL 5.1 on a Windows server, I&#8217;d recommend the following process.  Don&#8217;t skip the first steps that describe the uninstall and removal of the previous install as this seems to clear up most issues.   For the uninstall, I&#8217;d recommend manually deleting data files.  Caution: deleting the data files will delete any data previously entered into MySQL.</p>
<p>1.  Remove previous MySQL installs (and remnants)</p>
<p>a.  Stop the MySQL service ( Start | Control Panel | Administrative Tools | Services)</p>
<p><img class="alignnone size-medium wp-image-43" title="Picture 2" src="http://lstigile.files.wordpress.com/2009/06/picture-22.png?w=300&#038;h=140" alt="Picture 2" width="300" height="140" /></p>
<p>b.  Remove MySQL using Windows Add or Remove Programs (Start | Control Panel | Add or Remove Programs)</p>
<p><img class="alignnone size-medium wp-image-44" title="Picture 3" src="http://lstigile.files.wordpress.com/2009/06/picture-31.png?w=300&#038;h=97" alt="Picture 3" width="300" height="97" /><br />
c.  Clean up (delete) the data directory  (assuming that you don&#8217;t have data that you need) c:\documents and settings\all users\application data\mysql<br />
 </p>
<p><img class="alignnone size-medium wp-image-50" title="Picture 4" src="http://lstigile.files.wordpress.com/2009/06/picture-42.png?w=300&#038;h=158" alt="Picture 4" width="300" height="158" /></p>
<p> </p>
<p>d.  Clean up (delete) any remaining directories under program files c:\program files\MySQL\MySQL Server 5.1 (or whatever version you&#8217;re using)</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>That&#8217;s it for the removal and clean up.  Now, we&#8217;ll begin the install.</p>
<p> </p>
<p>2.  The MySQL install is a two step process: running the installer (.MSI) and then running the MySQL configuration utility (MySQLInstanceConfig.exe).  Theoretically, the first step should install the data files and program files and the second step should set up the service, set the root password and start the service.  The installer is designed to call the configuration utility automatically.   Instead, I recommend running each process separately.   </p>
<p> </p>
<p>a.  Launch the installer from a command-line.  Here&#8217;s an example shell&gt;msiexec /log c:\install.txt /i mysql-5.1.34-win32.msi </p>
<p> </p>
<p>Note: You&#8217;ll need to change the name of the .msi file to match the name of the version that you&#8217;re installing.  If you&#8217;re not used to working at the command-line, you&#8217;ll either need to change the directory to the location of the mysql installation file or specify the full path.  For example, you may need to execute:  msiexec /log c:\install.txt /i &#8220;c:\Documents and Settings\Administrator\Desktop\mysql-5.1.34-win32.msi&#8221;</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>Continue through the wizard until you reach the final screen which says, &#8220;Wizard Completed&#8221;  <strong>There&#8217;s a checkbox to &#8220;Configure the MySQL Server now&#8221;.  <em>Uncheck</em> the box and select Finish</strong>.</p>
<p> </p>
<p> </p>
<div id="attachment_47" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-47" title="Picture 7" src="http://lstigile.files.wordpress.com/2009/06/picture-7.png?w=300&#038;h=227" alt="Uncheck the Configure box." width="300" height="227" /><p class="wp-caption-text">Uncheck the Configure box.</p></div>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> When the install has finished, please check c:\documents and settings\all users\application data\mysql\mysql server 5.1\data .  You should see a mysql and test directory.  </p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>Also, verify that files have been installed in c:\program files\MySQL\MySQL Server 5.1 </p>
<p>You should have a bin, Docs and share folder.  </p>
<p> </p>
<p>b.  Navigate to c:\program files\MySQL\MySQL Server 5.1\bin and launch the MySQLInstanceConfig.exe from a command-line.  Here&#8217;s an example.</p>
<p>shell&gt;MySQLInstanceConfig.exe “-lC:\mysql_install_log.txt” “</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>I suggest launching it from a command-line so that you can pass the -l parameter, which will create an install log in case you need to troubleshoot the problem.</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>Step through the wizard.  Make sure to remember the password that you assign in the wizard.</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>The install should complete successfully.</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>TROUBLESHOOTING</p>
<p>What if it didn&#8217;t work?</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>1.  Check the service from the control panel.  Is it running?  If so, try to log into MySQL.  I&#8217;ve seen instances where an error was received, but it completed successfully.  If it&#8217;s not running, try to start it and please post the complete error message.</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>2.  Check the error log.  It&#8217;s in C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data   It has an .err extension and you should be able to open it with notepad.  Ignore any errors about the innodb plugin not loading.  It&#8217;s a symptom, not the problem.  Look for an error about missing data files or a mismatch in file sizes.</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>3.  1045 error?  It should indicate Password: No or Password:yes.  If &#8220;yes&#8221;, it&#8217;s not a port issue, not a firewall issue &#8212; it&#8217;s a password issue.  It&#8217;s usually caused by not deleting out the data files from an old install.  The password is kept in the data directory and it&#8217;s likely that the password you entered during the previous install doesn&#8217;t match what you&#8217;re entering now.  You can either re-install after deleting all the files or try to reset your root password.  (resetting root password: http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html )</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p>4.  Still stuck?   In the instructions above, I specified c:\install.txt and c:\mysql_install_log.txt  Please check those and post the contents.</p>
<div><span style="font-family:Helvetica;line-height:normal;"><br />
</span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=39&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2009/06/15/mysql-windows-install-troubleshooting/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/06/picture-22.png?w=300" medium="image">
			<media:title type="html">Picture 2</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/06/picture-31.png?w=300" medium="image">
			<media:title type="html">Picture 3</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/06/picture-42.png?w=300" medium="image">
			<media:title type="html">Picture 4</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/06/picture-7.png?w=300" medium="image">
			<media:title type="html">Picture 7</media:title>
		</media:content>
	</item>
		<item>
		<title>Using libmysqld with Microsoft Visual C++ 2008 Express</title>
		<link>http://lstigile.wordpress.com/2009/05/19/using-libmysqld-with-microsoft-visual-c-2008-express/</link>
		<comments>http://lstigile.wordpress.com/2009/05/19/using-libmysqld-with-microsoft-visual-c-2008-express/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:46:55 +0000</pubDate>
		<dc:creator>lstigile</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[libmysqld]]></category>

		<guid isPermaLink="false">http://lstigile.wordpress.com/?p=14</guid>
		<description><![CDATA[[ Note: this post was updated on Dec 2, 2009 to correct dashes. In the original post, dash dash -- was showing up as a single dash. This is noted in the comments and has been corrected in the text below.] These are very (very) basic instructions for setting up a very simple application with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=14&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>[ Note: this post was updated on Dec 2, 2009 to correct dashes.  In the original post, dash dash <code> -- </code> was showing up as a single dash.  This is noted in the comments and has been corrected in the text below.]</p>
<p style="font:18px Helvetica;margin:0;">These are very (very) basic instructions for setting up a very simple application with Microsoft Visual C++ 2008 Express to use the MySQL Embedded Library (libmysqld).</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">The MySQL Embedded Library is a full version of the server that is available as a dynamic or static library.  Developers can run the library inside their application.  It&#8217;s extremely fast, easy to distribute and it&#8217;s ideal for stand-alone applications.  More information about the library can be found at http://dev.mysql.com/doc/refman/5.1/en/libmysqld.html</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">Having little experience using Visual C++, I&#8217;ve struggled to find instructions for setting up a project to use a dynamic library.  I finally got it to work thanks to Ulf Wendel&#8217;s blog about building a windows client using the Connector/C++ ( http://blog.ulf-wendel.de/?p=215 ).  I was able to take his tutorial, substitute the appropriate libmysqld entries and compile the project.  If you get lost following my instructions, refer back to Ulf&#8217;s blog.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">To develop a libmysqld application, you&#8217;ll need data files, the error message file ( errmsg.sys ), the appropriate libraries and header files.  To get these files, I&#8217;d recommend downloading and installing the full version of the server.  Also, it&#8217;s easier to design and build your database using the standard version of the server.  Once you have some data, stop the MySQL service and then create your application using libmysqld.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">Here&#8217;s the process that I used.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">Download the Windows MSI Installer (x86) from http://dev.mysql.com/downloads.    For this example, I downloaded and installed version 5.1.34.  I selected the option for a standard install.  After the install, you can create tables and design your database as needed.  For this example, I&#8217;m going to use the &#8220;user&#8221; table, which installs with MySQL.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">After the install, go to the services control panel ( Start | Control Panel | Administrative Tools | Services ) and stop MySQL.  You might also change the Startup type to &#8220;manual&#8221; to ensure that it doesn&#8217;t start on reboot and cause a conflict with your project.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">Locate required directories for setting up the project:</p>
<p style="font:18px Helvetica;margin:0;">1)  Data Files</p>
<p style="font:18px Helvetica;margin:0;">On Windows, the default location for data files is C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data  We&#8217;ll be accessing the user.MYD MyISAM table, which is located in the .\mysql subdirectory.  Similarly, If you were to create a database named world with a city table, there would be a corresponding world directory and city.MYD MyISAM table in the data directory.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">2) Error Message File</p>
<p style="font:18px Helvetica;margin:0;">The error message file ( errmsg.sys ) is required to start libmysqld.  By default, it&#8217;s located at C:\Program Files\MySQL\MySQL Server 5.1\share\english</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">3)  Header Files</p>
<p style="font:18px Helvetica;margin:0;">C:\Program Files\MySQL\MySQL Server 5.1\include</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">4) Embedded Library</p>
<p style="font:18px Helvetica;margin:0;">C:\Program Files\MySQL\MySQL Server 5.1\Embedded\DLL\release</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">Copy the libmysqld.dll from the embedded library path (above) to the c:\windows\system32 directory (or anywhere in your search path).  For deployment, you&#8217;ll probably want to include the embedded library with the executable.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">Time to setup up Microsoft Visual C++ Express</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">Launch Microsoft Visual C++ Express.  From the main menu, select File | New | Project</p>
<p style="font:18px Helvetica;margin:0;">
<p style="font:18px Helvetica;margin:0;">Choose a Win32 Console Application</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;"><img class="alignnone size-full wp-image-27" title="g1" src="http://lstigile.files.wordpress.com/2009/05/g11.jpg" alt="g1" width="540" height="371" /></p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">Select OK and Finish.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;min-height:22px;margin:0;">Right-click the project name in the Solution Explorer and select Properties.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;"><img class="alignnone size-full wp-image-28" title="g2" src="http://lstigile.files.wordpress.com/2009/05/g21.jpg" alt="g2" width="539" height="482" /></p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;min-height:22px;margin:0;">Expand Configuration Properties, C/C++ Properties and add the following for the Additional Include Directories:</p>
<p style="font:18px Helvetica;margin:0;">C:\Program Files\MySQL\MySQL Server 5.1\include</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;"><img class="alignnone size-full wp-image-31" title="g3" src="http://lstigile.files.wordpress.com/2009/05/g33.jpg" alt="g3" width="748" height="520" /></p>
<p style="font:18px Helvetica;margin:0;">
<p style="font:18px Helvetica;margin:0;">Expand Linker, select General and add the following to Additional Library Directories: C:\Program Files\MySQL\ MySQL Server 5.1\ Embedded\ DLL\release<img class="alignnone size-full wp-image-36" title="g4" src="http://lstigile.files.wordpress.com/2009/05/g41.jpg" alt="g4" width="746" height="521" /></p>
<p style="font:18px Helvetica;margin:0;">Select Linker, Input and add the following for Additional Dependencies: libmysqld.lib<span style="font-family:Georgia;line-height:19px;"><img class="alignnone size-full wp-image-33" title="g5" src="http://lstigile.files.wordpress.com/2009/05/g51.jpg" alt="g5" width="747" height="519" /></span></p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">
<p style="font:18px Helvetica;margin:0;">Select OK to save the setting and return to the project.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">Copy the following into the source file ( my copy is named sample.cpp )  Overwrite any existing code in the file.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#0000ff;">#include</span><span style="color:#000000;"> </span>&#8220;stdafx.h&#8221;</p>
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#0000ff;">#include</span><span style="color:#000000;"> </span>&lt;stdlib.h&gt;</p>
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#0000ff;">#include</span><span style="color:#000000;"> </span>&lt;iostream&gt;</p>
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#0000ff;">#include</span><span style="color:#000000;"> </span>&lt;stdio.h&gt;</p>
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#0000ff;">#include</span><span style="color:#000000;"> </span>&lt;stdarg.h&gt;</p>
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#0000ff;">#include</span><span style="color:#000000;"> </span>&lt;windows.h&gt;</p>
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#0000ff;">#include</span><span style="color:#000000;"> </span>&lt;mysql.h&gt;</p>
<p style="font:16px Helvetica;color:#a31515;min-height:19px;margin:0;">
<p style="font:16px Helvetica;margin:0;">MYSQL *mysql;</p>
<p style="font:16px Helvetica;margin:0;">MYSQL_RES *results;</p>
<p style="font:16px Helvetica;margin:0;">MYSQL_ROW record;</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#0000ff;">static</span><span style="color:#000000;"> </span><span style="color:#0000ff;">char</span><span style="color:#000000;"> *server_options[] = { </span>&#8220;mysql_test&#8221;<span style="color:#000000;">, </span>&#8220;<code>--datadir=C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/data</code>&#8220;<span style="color:#000000;">,</span></p>
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#000000;"> </span>&#8220;<code>--language=C:/Program Files/MySQL/MySQL Server 5.1/share/english"</code><span style="color:#000000;">,  NULL };</span></p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;margin:0;"><span style="color:#0000ff;">int</span> num_elements = <span style="color:#0000ff;">sizeof</span>(server_options)/ <span style="color:#0000ff;">sizeof</span>(<span style="color:#0000ff;">char</span> *) &#8211; 1;</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;margin:0;"><span style="color:#0000ff;">static</span> <span style="color:#0000ff;">char</span> *server_groups[] = { <span style="color:#a31515;">&#8220;libmysqld_server&#8221;</span>, NULL };</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;margin:0;"><span style="color:#0000ff;">int</span> main(<span style="color:#0000ff;">int</span> argc, <span style="color:#0000ff;">char</span>* argv[])</p>
<p style="font:16px Helvetica;margin:0;"><span style="white-space:pre;"> </span>{</p>
<p style="font:16px Helvetica;margin:0;"><span style="white-space:pre;"> </span><span style="color:#0000ff;">int</span> retval;</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;margin:0;">retval = mysql_library_init(num_elements, server_options, (<span style="color:#0000ff;">char</span> **)             server_groups);</p>
<p style="font:16px Helvetica;margin:0;">mysql = mysql_init(NULL);</p>
<p style="font:16px Helvetica;margin:0;">mysql_options(mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, NULL);</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;margin:0;">mysql_real_connect(mysql, NULL,<span style="color:#a31515;">&#8220;root&#8221;</span>,NULL, <span style="color:#a31515;">&#8220;mysql&#8221;</span>, 0, NULL, 0);</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#000000;"> mysql_query(mysql, </span>&#8220;SELECT user, host FROM user&#8221;<span style="color:#000000;">);</span></p>
<p style="font:16px Helvetica;margin:0;">results = mysql_store_result(mysql);</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;margin:0;"><span style="color:#0000ff;">while</span>((record = mysql_fetch_row(results))) {</p>
<p style="font:16px Helvetica;margin:0;">printf(<span style="color:#a31515;">&#8220;%s &#8211; %s \n&#8221;</span>, record[0], record[1]);</p>
<p style="font:16px Helvetica;margin:0;">}</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;margin:0;">mysql_free_result(results);</p>
<p style="font:16px Helvetica;margin:0;">mysql_close(mysql);</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:16px Helvetica;margin:0;"><span style="color:#0000ff;">return</span> 0;</p>
<p style="font:16px Helvetica;margin:0;">}</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">At this point, you should be able to build and run your project.  The output should look like this.</p>
<p style="font:normal normal normal 18px/normal Helvetica;min-height:22px;text-align:center;margin:0;"><img class="size-full wp-image-21 aligncenter" title="g6" src="http://lstigile.files.wordpress.com/2009/05/g6.jpg" alt="g6" width="286" height="57" /></p>
<p style="font:18px Helvetica;margin:0;">
<p style="font:18px Helvetica;margin:0;">It&#8217;s a simple listing of the users in the mysql table.</p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">The following line of code is critical:</p>
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#0000ff;">static</span><span style="color:#000000;"> </span><span style="color:#0000ff;">char</span><span style="color:#000000;"> *server_options[] = { </span>&#8220;mysql_test&#8221;<span style="color:#000000;">, </span>&#8220;<code>--datadir=C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/data</code>&#8220;<span style="color:#000000;">,</span></p>
<p style="font:16px Helvetica;color:#a31515;margin:0;"><span style="color:#000000;"> </span>&#8220;<code>--language=C:/Program Files/MySQL/MySQL Server 5.1/share/english"</code><span style="color:#000000;">,  NULL };</span></p>
<p style="font:18px Helvetica;min-height:22px;margin:0;">
<p style="font:18px Helvetica;margin:0;">You must have a datadir and a language file.  Note the forward slash in the directory paths.  Of course, these paths can be located anywhere.  You&#8217;ll probably want to move these folders to a subdirectory under your application install.  If you don&#8217;t see an error log in the data directory, that&#8217;s also an indicator that these paths are incorrect.</p>
<p style="font:16px Helvetica;min-height:19px;margin:0;">
<p style="font:18px Helvetica;margin:0;">I hope someone finds this useful.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lstigile.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lstigile.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lstigile.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lstigile.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lstigile.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lstigile.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lstigile.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lstigile.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lstigile.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lstigile.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lstigile.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lstigile.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lstigile.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lstigile.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lstigile.wordpress.com&amp;blog=2399575&amp;post=14&amp;subd=lstigile&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lstigile.wordpress.com/2009/05/19/using-libmysqld-with-microsoft-visual-c-2008-express/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12664c1a1790bfc9601c7ef31672f498?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lstigile</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/05/g11.jpg" medium="image">
			<media:title type="html">g1</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/05/g21.jpg" medium="image">
			<media:title type="html">g2</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/05/g33.jpg" medium="image">
			<media:title type="html">g3</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/05/g41.jpg" medium="image">
			<media:title type="html">g4</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/05/g51.jpg" medium="image">
			<media:title type="html">g5</media:title>
		</media:content>

		<media:content url="http://lstigile.files.wordpress.com/2009/05/g6.jpg" medium="image">
			<media:title type="html">g6</media:title>
		</media:content>
	</item>
	</channel>
</rss>
