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

<channel>
	<title>tech stuff &#187; batch</title>
	<atom:link href="http://codytaylor.org/tag/batch/feed" rel="self" type="application/rss+xml" />
	<link>http://codytaylor.org</link>
	<description>From Cody Taylor.</description>
	<lastBuildDate>Sun, 30 Oct 2011 04:15:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Automated MySQL Install On Windows</title>
		<link>http://codytaylor.org/2009/08/automated-msi-mysql-install-on-windows.html</link>
		<comments>http://codytaylor.org/2009/08/automated-msi-mysql-install-on-windows.html#comments</comments>
		<pubDate>Wed, 19 Aug 2009 02:10:34 +0000</pubDate>
		<dc:creator>Cody Taylor</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[automated]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[hands free]]></category>

		<guid isPermaLink="false">http://codytaylor.org/?p=14232</guid>
		<description><![CDATA[Install MySQL with an automated windows batch file.]]></description>
			<content:encoded><![CDATA[<p>If you need to install MySQL databases on a number of machines with roughly the same configuration then it becomes extremely tedious to run the installer wizard on each machine. You can download the MySQL server as a msi package which allows you to install with the MSIEXEC DOS command in windows hands free. To install all the necessary files for MySQL to run you need to type this command at the console:</p>
<p>msiexec /qn /i mysql-essential-5.1.37-win32.msi INSTALLDIR=C:\MySQL</p>
<p>The &#8216;/qn&#8217; switch makes this install quiet. In this example I chose &#8216;C:\MySQL&#8217; as the install directory. Feel free to replace that path with whatever you choose. </p>
<p>Just because MySQL is installed and has all the appropriate files registered doesn&#8217;t mean that it&#8217;s useful. You will probably want it to run as a service, have it listen on a certain port, and have a root user already set up. This can be done with the MySQLInstanceConfig.exe program, although the arguments are a little more involved.<br />
<pre><code>
C:\MySQL\bin\MySQLInstanceConfig.exe -i -q 
&quot;-lC:\MySQL\mysql_install_log.txt&quot; 
&quot;-pC:\MySQL\bin&quot; &quot;-tC:\MySQL\my-template.ini&quot; 
&quot;-cC:\MySQL\my.ini&quot; -v5.1.37 
ServerType=DEVELOPMENT 
DatabaseType=MIXED 
ConnectionUsage=DSS 
Port=3306 
ServiceName=MySQL
RootPassword=root1234 
SkipNetworking=no 
AddBinToPath=yes
</code></pre></p>
<p>The entire string above must be run as one line. If you just copy and paste then the console will error out. Most of the arguments above are straight forward if you&#8217;ve ever configured a MySQL server before but just in case I&#8217;ve detailed the parameters below.<br />
</p>
<p>-n product name<br />
-p path of installation (no \bin)<br />
-v version</p>
<p>Actions:<br />
-i (install instance)<br />
-r (remove instance)<br />
-s (stop instance)<br />
-q (be quiet)<br />
-lfilename (write log file)</p>
<p>When launched manually, these can also be submitted<br />
-t<.cnf template filename><br />
-c<.cnf filename></p>
<p>Use the following options to define the parameters for the configuration file generation.<br />
ServiceName=$<br />
AddBinToPath={yes | no}<br />
ServerType={DEVELOPMENT | SERVER | DEDICATED}<br />
DatabaseType={MIXED | INNODB | MYISAM}<br />
ConnectionUsage={DSS | OLTP}<br />
ConnectionCount=#<br />
SkipNetworking={yes | no}<br />
Port=#<br />
StrictMode={yes | no}<br />
Charset=$<br />
RootPassword=$<br />
RootCurrentPassword=$ </p>
<p>So if you use the example above you will get a basic mysql installation. When I used these commands I put them in a batch file followed by this command:</p>
<p>
mysql &#8211;user=user_name &#8211;password=your_password db_name < create_database_and_tables.sql</p>
<p>The &#8216;create_database_and_tables.sql&#8217; obviously has all the sql code to create the MySQL databases and tables that are needed. The batch file installed, configured, and structured my MySQL databases. I spent awhile yesterday looking for a post like this so hopefully this saves someone some time.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fcodytaylor.org%2F2009%2F08%2Fautomated-msi-mysql-install-on-windows.html&amp;linkname=Automated%20MySQL%20Install%20On%20Windows"><img src="http://codytaylor.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://codytaylor.org/2009/08/automated-msi-mysql-install-on-windows.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

