<?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>gregs &#187; MySQL</title>
	<atom:link href="http://gregs.tcias.co.uk/category/comps/database/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://gregs.tcias.co.uk</link>
	<description>helping me remember what I figure out</description>
	<lastBuildDate>Sun, 13 Jun 2010 02:16:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Upgrading to Lenny</title>
		<link>http://gregs.tcias.co.uk/2010/03/09/upgrading-to-lenny/</link>
		<comments>http://gregs.tcias.co.uk/2010/03/09/upgrading-to-lenny/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 06:52:56 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linode]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=481</guid>
		<description><![CDATA[It's been  while since I attended to my VPS, I decided to spend some time last night upgrading my distribution from Etch to Lenny. This is normally a moment where your heart sinks as quite a few things do tend to go belly up, but I am happy to report that I only came [...]]]></description>
			<content:encoded><![CDATA[<p>It's been  while since I attended to my VPS, I decided to spend some time last night upgrading my distribution from Etch to Lenny. This is normally a moment where your heart sinks as quite a few things do tend to go belly up, but I am happy to report that I only came across some minor issues and these were resolved in minutes as opposed to hours.</p>
<ol>
<li>MySQL : failed to start, complaining about:
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showPlainTxt('code-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">/etc/init.<span style="">d</span>/mysql: ERROR: Using expire_logs_days without log_bin crashes</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">the server. <span style="">See</span> README.<span style="">Debian</span>.<span style="">gz</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Commenting out the expire_logs_days in the my.cnf file allowed me to restart MySQL.</li>
<li>After the upgrade of Apache, my virtual hosts weren't working. A quick search via Google <a href="http://www.pc-freak.net/blog/solution-to-a-problem-with-virtualhosts-on-debian-lenny-default-virtualhost-opening-by-default-overwritting-the-rest-of-the-configured-virtualhosts/">pointed me to this post</a> - a quick edit of all of my host files and it was all working again.</li>
<li>the php-mysql connector somehow hadn't been upgraded/installed so a quick
<div class="igBar"><span id="lcode-5"><a href="#" onclick="javascript:showPlainTxt('code-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-5">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">apt-get install php5-mysql </div>
</li>
</ol>
</div>
</div>
</div>
<p>fixed that problem.</li>
<li>OpenBD : the only thing that remains broken was my tomcat5.5 Open BD install. Tomcat was working fine but Open BD refused to start up complaining about :
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showPlainTxt('code-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">javax.<span style="">servlet</span>.<span style="">ServletException</span>: Open BlueDragon Engine Failed to initialise tags: java.<span style="">awt</span>.<span style="">Color</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>Since I am not really using it, it's not that important, but at some stage I'd like to get it working again. If you have any suggestions, please leave a comment.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2010/03/09/upgrading-to-lenny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beyond SQL injection attacks</title>
		<link>http://gregs.tcias.co.uk/2006/11/23/beyond-sql-injection-attacks/</link>
		<comments>http://gregs.tcias.co.uk/2006/11/23/beyond-sql-injection-attacks/#comments</comments>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=157</guid>
		<description><![CDATA[Courtesy of Slashdot a reminder that you should also worry about other types of injection attacks. Don't you just wish that everybody would play nice?
UPDATE
In a similar vein, Nadav Samet covers off in more detail Cross Site Scripting attacks, how they work and what you can do to protect your site.
]]></description>
			<content:encoded><![CDATA[<p>Courtesy of Slashdot a reminder that you should also worry about <a title="Malicious Code Injection: It's Not Just for SQL Anymore" href="http://www.site-reference.com/articles/Website-Development/Malicious-Code-Injection-It-s-Not-Just-for-SQL-Anymore.html">other types of injection attacks</a>. Don't you just wish that everybody would play nice?</p>
<p>UPDATE</p>
<p>In a similar vein, Nadav Samet <a title="Prepare for Attack!â€”Making Your Web Applications More Secure" href="http://www.thesamet.com/blog/2007/01/16/prepare-for-attack%e2%80%94making-your-web-applications-more-secure/">covers off in more detail</a> Cross Site Scripting attacks, how they work and what you can do to protect your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2006/11/23/beyond-sql-injection-attacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AUTO INCREMENT</title>
		<link>http://gregs.tcias.co.uk/2006/06/29/auto-increment/</link>
		<comments>http://gregs.tcias.co.uk/2006/06/29/auto-increment/#comments</comments>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=162</guid>
		<description><![CDATA[Since the MySQL Query Browser on my Mac refused to let me set a field as auto increment through the GUI, here's how you can using SQL change an existing column to use auto_increment:
PLAIN TEXT
SQL:




ALTER TABLE `aggregatedWeekly` CHANGE `Id` `Id` INT&#40; 6 &#41; UNSIGNED NOT NULL AUTO_INCREMENT 






UPDATE
I have also recently found out that the [...]]]></description>
			<content:encoded><![CDATA[<p>Since the MySQL Query Browser on my Mac refused to let me set a field as auto increment through the GUI, here's how you can using SQL change an existing column to use auto_increment:</p>
<div class="igBar"><span id="lsql-9"><a href="#" onclick="javascript:showPlainTxt('sql-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-9">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`aggregatedWeekly`</span> <span style="color: #993333; font-weight: bold;">CHANGE</span> <span style="color: #ff0000;">`Id`</span> <span style="color: #ff0000;">`Id`</span> INT<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color: #cc66cc;color:#800000;">6</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #993333; font-weight: bold;">UNSIGNED</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>UPDATE</h4>
<p>I have also recently found out that the following works just as well:</p>
<p><code>
<div class="igBar"><span id="lsql-10"><a href="#" onclick="javascript:showPlainTxt('sql-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-10">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`aggregatedWeekly`</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span>=<span style="color: #cc66cc;color:#800000;">1</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2006/06/29/auto-increment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring MyODBC on NT</title>
		<link>http://gregs.tcias.co.uk/2000/10/17/configuring-myodbc-on-nt/</link>
		<comments>http://gregs.tcias.co.uk/2000/10/17/configuring-myodbc-on-nt/#comments</comments>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=285</guid>
		<description><![CDATA[This is effectively part II of configuring MySQL for NT. With the help of this document you will be able to access your MySQL database server from other Windows applications (e.g. Cold Fusion). Right so let's get started. We shall begin with installing MyODBC (a copy of which can be obtained from here http://www.mysql.com/downloads/api-myodbc.html).
Installing MyODBC [...]]]></description>
			<content:encoded><![CDATA[<p>This is effectively part II of configuring MySQL for NT. With the help of this document you will be able to access your MySQL database server from other Windows applications (e.g. Cold Fusion). Right so let's get started. We shall begin with installing MyODBC (a copy of which can be obtained from here <a href="http://www.mysql.com/downloads/api-myodbc.html">http://www.mysql.com/downloads/api-myodbc.html</a>).</p>
<p>Installing MyODBC is straightforward. Unzip the downloaded file and click on the <strong>setup.exe</strong> file and simply follow the installation prompts. For starters just keep accepting the default settings if you are unsure of any options.</p>
<p>OK, now we are ready to add a <strong>MySQL</strong> datasource. You have to do this through <em>ODBC datasources</em> in the <strong>Control Panel</strong>. Please note: if you were planning on using the Cold Fusion Administrator, you can't. You have to go through the <strong>Control Panel</strong> to initially configure the datasource. Once setup you can modify your <strong>MySQL</strong> datasources through the Cold Fusion Administrator. So go ahead and fire up your ODBC manager.</p>
<p>Once open, go to the the <strong>system DNS</strong> tab and select <em>Add...</em>. From the list of available drivers select <strong>MySQL</strong> and click <em>Finish</em>. This should fire up a dialogue with a whole bunch of fields. Listed below is a sample entry:</p>
<div class="igBar"><span id="lcode-12"><a href="#" onclick="javascript:showPlainTxt('code-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-12">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Windows DNS name: mydsn</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">MySQL host <span style="color:#006600; font-weight:bold;">&#40;</span>name or ip<span style="color:#006600; font-weight:bold;">&#41;</span>: <span style="color:#800000;color:#800000;">127</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">MySQL database name: mydatabase</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">User: myusername</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Password: mypassword </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Things to bear in mind are: from my personal experience, I found that it's best to keep windows DSN and database name in lower case. Specifying the IP address works, I have had problems using the host name setting. As for the username and password, make sure that you use those properties that you set to the database you created. I.e. if you don't require a logon to connect to that database, then leave the fields blank. Else enter the username and password assigned to that database (the default <strong>root</strong> account will work well, but is contentious for security reasons).</p>
<p>Well we are done you should know have configured your system to connect to a MySQL database via ODBC.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2000/10/17/configuring-myodbc-on-nt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring MySQL on NT</title>
		<link>http://gregs.tcias.co.uk/2000/10/17/configuring-mysql-on-nt/</link>
		<comments>http://gregs.tcias.co.uk/2000/10/17/configuring-mysql-on-nt/#comments</comments>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=286</guid>
		<description><![CDATA[In the following I will talk you through setting up MySQL on an NT box and running it as a service. We will also shore up the security a bit, create a database and connect to it. To start it all off you will need the install files you can grab these from the MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>In the following I will talk you through setting up MySQL on an NT box and running it as a service. We will also shore up the security a bit, create a database and connect to it. To start it all off you will need the install files you can grab these from the <a href="http://www.mysql.com/">MySQL</a> web site (<a href="http://www.mysql.com/">http://www.mysql.com/</a>. Go to the downloads section and find the relevant compiled files [The last time I looked all I could find where the beta compiled files @ <a href="http://www.mysql.com/downloads/mysql-3.23.html">http://www.mysql.com/downloads/mysql-3.23.html</a>]. The source files are usually stored in a Zip archive so you will need to extract them. Once that is done run <strong>setup.exe</strong> and follow the prompts.</p>
<p>OK so far so good. Now you will need to setup MySQL to run as a service. This is easy just switch to <strong>c:\mysql\bin</strong>. There you will see a file called <strong>mysqld-nt.exe</strong>. This is the file that installs MySQL as a service on your NT box. You install the service with the following command:</p>
<div class="igBar"><span id="lcode-15"><a href="#" onclick="javascript:showPlainTxt('code-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-15">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysqld-nt --install </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>After a couple of seconds (or less depending on the speed of your machine) the service is installed and you can test the installation (it doesn't tell you  if the service has been successfully installed or not) by typing: <em>net start MySQL</em> (incidentally should you wish to stop the server just type <em>net stop MySQL</em>). NT should inform you that the service is starting and whether it has started successfully or not.</p>
<p>On to the next stage. We will now secure the database server a little bit. As per the default installation the Administrator username is <strong>root</strong> and it has no password set. As you can imagine this is a serious security hazard. So in the following we are going to reset the password, by logging into MySQL (specifically the system database <strong>mysql</strong>) and removing the default user account, exiting the server reloading it and re-setting the password for root. Simply type the commands in listed below (you can read through the documentation on this subject at http://127.0.0.1/{your SQL documentation mapping}/manual.html#Win32, section 4.12.4):</p>
<div class="igBar"><span id="lcode-16"><a href="#" onclick="javascript:showPlainTxt('code-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-16">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">C:\mysql\bin\mysql mysql</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysql&amp;gt;; DELETE FROM user WHERE Host=<span style="color:#CC0000;">'localhost'</span> AND User=<span style="color:#CC0000;">''</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysql&amp;gt;; QUIT</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">C:\mysql\bin\mysqladmin reload</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">C:\mysql\bin\mysqladmin -u root password<span style="color:#006600; font-weight:bold;">&#123;</span>your password<span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Next we will test whether your changes were successful, try login back into the database server, from the command prompt type <em>mysql -u root -p mysql</em> this should prompt you for a password. Type in the password you have just specified and you be logged in. Don't log out because we are now going to create another database. The steps syntax is very simple for this. From the MySQL command prompt type: <em>create database &lt;your database name&gt; ;</em>. Now type <em>show databases;</em> and this should provide you with a list of databases available.</p>
<p>Well there you go. You know should be able to install, configure, secure and create a database in <strong>MySQL</strong>. In the coming days I will try and write up something about installing MyODBC so that you can get other applications (such as Cold Fusion) to talk to MySQL. I hope you found this article useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2000/10/17/configuring-mysql-on-nt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Cold Fusion and MySQL</title>
		<link>http://gregs.tcias.co.uk/2000/10/17/configuring-cold-fusion-and-mysql/</link>
		<comments>http://gregs.tcias.co.uk/2000/10/17/configuring-cold-fusion-and-mysql/#comments</comments>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=284</guid>
		<description><![CDATA[Configuring Cold Fusion and MySQL
Listed in this document will be a collection of problems I encountered while working with both Cold Fusion and MySQL, and some of the work arounds/solutions I have come across to resolve these problems.

When planning to store and display large amounts of data in a text field, you have to be [...]]]></description>
			<content:encoded><![CDATA[<h3>Configuring Cold Fusion and MySQL</h3>
<p class="1">Listed in this document will be a collection of problems I encountered while working with both <strong>Cold Fusion</strong> and <strong>MySQL</strong>, and some of the work arounds/solutions I have come across to resolve these problems.</p>
<ul>
<li>When planning to store and display large amounts of data in a text field, you have to be aware of a setting in the Cold Fusion Administrator. By default the <strong>Long Text Buffer Size</strong> is limited to <em>65,000</em> characters. As a result should you have more than <em>65,000</em> characters to display the excess will be chopped. This problem can be fixed by either increasing the <strong>Long Text Buffer Size</strong> (better for performance, but still has an impact) or by enabling <strong>Long Text Retrieval Settings</strong> (can have an impact on performance). These settings can be reached by editing the datasource properties.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2000/10/17/configuring-cold-fusion-and-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
