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

<channel>
	<title>MySQL Expert &#124; MySQL Performance &#124; MySQL Consulting &#187; best practices</title>
	<atom:link href="http://ronaldbradford.com/blog/tag/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://ronaldbradford.com/blog</link>
	<description>Expert times and information on MySQL</description>
	<lastBuildDate>Tue, 07 Sep 2010 18:45:10 +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>Improving MySQL Productivity &#8211; From Design to Implementation</title>
		<link>http://ronaldbradford.com/blog/improving-mysql-productivity-from-design-to-implementation-2010-07-01/</link>
		<comments>http://ronaldbradford.com/blog/improving-mysql-productivity-from-design-to-implementation-2010-07-01/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 22:18:55 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Kaleidoscope 2010]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle/MySQL Conferences]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[odtug]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[ROI]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2999</guid>
		<description><![CDATA[My closing presentation at the dedicated MySQL track at ODTUG Kaleidoscope 2010 discussed various techniques and best practices for improving the ROI of developer resources using MySQL.  Included in the sections on Design, Security, Development, Testing, Implementation, Instrumentation and Support were also a number of horror stories of not what to do, combined with [...]]]></description>
			<content:encoded><![CDATA[<p>My closing presentation at the dedicated <a href="http://www.odtugkaleidoscope.com/MySQL.html">MySQL track</a> at ODTUG Kaleidoscope 2010 discussed various techniques and best practices for improving the ROI of developer resources using MySQL.  Included in the sections on Design, Security, Development, Testing, Implementation, Instrumentation and Support were also a number of horror stories of not what to do, combined with practical examples of improving productivity.</p>
<div style="width:425px" id="__ss_4662355"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/ronaldbradford/increasing-mysql-productivity" title="Increasing MySQL Productivity">Increasing MySQL Productivity</a></strong><object id="__sse4662355" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=increasingmysqlproductivity-100701171249-phpapp01&#038;stripped_title=increasing-mysql-productivity" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4662355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=increasingmysqlproductivity-100701171249-phpapp01&#038;stripped_title=increasing-mysql-productivity" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/ronaldbradford">Ronald Bradford</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/improving-mysql-productivity-from-design-to-implementation-2010-07-01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best Practices: Additional User Security</title>
		<link>http://ronaldbradford.com/blog/best-practices-additional-user-security-2010-06-03/</link>
		<comments>http://ronaldbradford.com/blog/best-practices-additional-user-security-2010-06-03/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 16:12:50 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2842</guid>
		<description><![CDATA[By default MySQL allows you to create user accounts and privileges with no password. In my earlier MySQL Best Practices: User Security I describe how to address the default installation empty passwords.
For new user accounts, you can improve this default behavior  using the SQL_MODE variable, with a value of NO_AUTO_CREATE_USER.  As detailed via [...]]]></description>
			<content:encoded><![CDATA[<p>By default MySQL allows you to create user accounts and privileges with no password. In my earlier <a href="http://ronaldbradford.com/blog/mysql-best-practices-user-security-2010-05-21/">MySQL Best Practices: User Security</a> I describe how to address the default installation empty passwords.</p>
<p>For new user accounts, you can improve this default behavior  using the SQL_MODE variable, with a value of NO_AUTO_CREATE_USER.  As detailed via the <a href="http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html#sqlmode_no_auto_create_user">5.1 Reference Manual</a><br />
<i><br />
NO_AUTO_CREATE_USER</p>
<p>Prevent the GRANT statement from automatically creating new users if it would otherwise do so, unless a nonempty password also is specified.<br />
</i></p>
<p>Having set this variable I attempted to show the error of operation to demonstrate in my upcoming &#8220;MySQL Idiosyncrasies that bite&#8221; presentation.</p>
<h3>Confirm Settings</h3>
<pre>
mysql> show global variables like 'sql_mode';
+---------------+---------------------+
| Variable_name | Value               |
+---------------+---------------------+
| sql_mode      | NO_AUTO_CREATE_USER |
+---------------+---------------------+
1 row in set (0.00 sec)

mysql> show session variables like 'sql_mode';
+---------------+---------------------+
| Variable_name | Value               |
+---------------+---------------------+
| sql_mode      | NO_AUTO_CREATE_USER |
+---------------+---------------------+
1 row in set (0.00 sec)
</pre>
<h3>Create error condition</h3>
<pre>
mysql> CREATE USER superuser@localhost;
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON *.* TO superuser@localhost;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
</pre>
<p>What the? Surely this isn&#8217;t right.</p>
<pre>
$ mysql -usuperuser

mysql> SHOW GRANTS;
+--------------------------------------------------------+
| Grants for superuser@localhost                         |
+--------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'superuser'@'localhost' |
+--------------------------------------------------------+

mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 5.1.39    |
+-----------+
</pre>
<p>Well that&#8217;s broken functionality.</p>
<p>What should happen as described in <a href="http://bugs.mysql.com/bug.php?id=43938">Bug #43938</a> is a cryptic message as reproduced below.</p>
<pre>
mysql> GRANT SELECT ON foo.* TO 'geert12'@'localhost';
ERROR 1133 (42000): Can't find any matching row in the user table
mysql> GRANT SELECT ON *.* TO geert12@localhost IDENTIFIED BY 'foobar';
Query OK, 0 rows affected (0.00 sec)
</pre>
<p>It seems however that the user of CREATE USER first nullifies this expected behavior, hence new <a href="http://bugs.mysql.com/bug.php?id=54208">Bug #54208</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/best-practices-additional-user-security-2010-06-03/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL Best Practices: User Security</title>
		<link>http://ronaldbradford.com/blog/mysql-best-practices-user-security-2010-05-21/</link>
		<comments>http://ronaldbradford.com/blog/mysql-best-practices-user-security-2010-05-21/#comments</comments>
		<pubDate>Fri, 21 May 2010 18:36:37 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2800</guid>
		<description><![CDATA[It is critical that you do not use the default MySQL installation security, it&#8217;s simply insecure.
Default Installation
When installed, MySQL enables any user with physical permissions to the server to connect to the MySQL via unauthenticated users. MySQL also provides complete access to all super user privileges via the ‘root’ user with no default password. 

$ [...]]]></description>
			<content:encoded><![CDATA[<p>It is critical that you do not use the default MySQL installation security, it&#8217;s simply insecure.</p>
<h3>Default Installation</h3>
<p>When installed, MySQL enables any user with physical permissions to the server to connect to the MySQL via unauthenticated users. MySQL also provides complete access to all super user privileges via the ‘root’ user with no default password. </p>
<pre>
$ mysql -uroot
mysql> SELECT host,user,password FROM mysql.user;
+--------------+------+-------------------------------------------+
| host         | user | password                                  |
+--------------+------+-------------------------------------------+
| localhost    | root |                                           |
| server.local | root |                                           |
| 127.0.0.1    | root |                                           |
| localhost    |      |                                           |
| server.local |      |                                           |
+--------------+------+-------------------------------------------+
</pre>
<p>What you see here are two types of users. </p>
<ul>
<li>The ‘root’ user which has MySQL super user privileges for your server or ‘localhost’ connections with no password. </li>
<li>Unauthenticated users indicated by the blank ‘user’ column</li>
</ul>
<p>The absolute minimum you should do, is run the provided optional command for immediate improvements <b> mysql_secure_installation</b>. When running this command, you’re prompted for the following<br />
options —  the output has been trimmed for presentations purposes. </p>
<pre>
$ mysql_secure_installation
Enter current password for root (enter for none):
Set root password? [Y/n] y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
</pre>
<p>If you revisit permissions now, you’ll see what you would expect from a more initially secure installation. </p>
<pre>
mysql> SELECT host,user,password FROM mysql.user;
+-----------+------+-------------------------------------------+
| host      | user | password                                  |
+-----------+------+-------------------------------------------+
| localhost | root | *FDAF706717E70DB8DDAD0C5214B13770E1A80B0E |
+-----------+------+-------------------------------------------+
</pre>
<p>This is only the first step to hardening your MySQL instance and server.</p>
<h3>Recommendations</h3>
<p>The following are my recommendations for the minimum MySQL security permissions:</p>
<ul>
<li>Always set a MySQL ‘root’ user password
<li>Change the MySQL ‘root’ user id to a different name, e.g. ‘dba’
<li>Only enable SUPER privileges to dba accounts, and only ever for ‘localhost’.
<li>Application user permissions should be as restrictive as possible.
<li>Never use ‘%’ for a hostname
<li>Never use ALL TO *.*
<li>Ideally the application should have at least two types of users, a read/write user and a read user.
</ul>
<p>There is a lot more information about physical Operating System security and the MySQL permission/privilege model to be discussed.  One product I know of that help is <a href="http://www.securich.com/">SecuRich</a> &#8211; The MySQL Security Package featuring roles, password history and many other cool functionalities.</p>
<h3>References</h3>
<p>A recent post by <a href="https://www.infosecisland.com/">Lance Miller</a> quoted the following.</p>
<p><i><br />
I cant tell you how many times in the past 18 months that I’ve found real enterprises running vulnerable databases with default passwords, weak passwords and no real permissions management. It’s bad enough that the stats right now are this (so I guess I can tell you):<br />
- 9 out of 10 organizations have a Microsoft SQL Database with a blank “sa” password (or an sa password of “sa”, “sql” or “password”)<br />
- 9 out of 10 organizations have a Postgres Database with a default password<br />
- 9 out of 10 organizations have a Sybase Database with a default password<br />
</i></p>
<p>The article didn&#8217;t include MySQL however some organizations don&#8217;t change the default password, probably not 9 of 10 in my experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/mysql-best-practices-user-security-2010-05-21/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Testability</title>
		<link>http://ronaldbradford.com/blog/testability-2009-10-02/</link>
		<comments>http://ronaldbradford.com/blog/testability-2009-10-02/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 03:54:25 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Benchmarking]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Extreme Programming (XP)]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[agile methodology]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[stress testing]]></category>
		<category><![CDATA[testability]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=2167</guid>
		<description><![CDATA[If I was to provide one tip for organizations on how to implement a successful technology solution, I would state you need to ensure your product/software/system is completely testable.  Independent on how you elect to test your system, the design of creating a completely testable infrastructure will enable exponential savings as your business grows.
You [...]]]></description>
			<content:encoded><![CDATA[<p>If I was to provide one tip for organizations on how to implement a successful technology solution, I would state you need to ensure your product/software/system is completely testable.  Independent on how you elect to test your system, the design of creating a completely testable infrastructure will enable exponential savings as your business grows.</p>
<p>You achieve this by implementing an Application Programming Interface (API) for all data access.  Your goal should be to move away from technology dependence and towards a technology agnostic solution, your dependency is now your business specification.  This does not mean you are going to expose this API to the Internet, your own applications are your first clients, your web site and your management reporting tools. Your website is just a client presentation of your most valuable asset, your information. </p>
<p>Creating an environment that enables you test and verify your information independently from how is renders in a browser, enables a complete level of possible automation for testing this component of your communication channel.  While end to end testing is also necessary, this becomes more complex and is impractical if this is your only means of testing.  The principle of any popular Agile methodology approach is around testing where one popular term is Test Driven Development (TDD). While you may not implement TDD, knowing and applying the principals enables testability.</p>
<p>As you continue to grow, you will realize you now have the infrastructure and ability to stress test your most important system features.  It is a common misconception that testing is about ensuring your software works as designed. Testing should not be about what works, but what doesn&#8217;t break. The goal of testing should be to break your software.  The ability to stress test your system is to know when your system will fail. This ability to predict can benefit you ahead of time.  You do not want your startup to suffer a successful catastrophe where you meet all your marketing goals, but you system crashes, and while the &#8220;Twitter failed whale&#8221; is frustrating, this is one approach attempt to mediate a total failure.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/testability-2009-10-02/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Percona Performance Conference Talk</title>
		<link>http://ronaldbradford.com/blog/percona-performance-conference-talk-2009-04-23/</link>
		<comments>http://ronaldbradford.com/blog/percona-performance-conference-talk-2009-04-23/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 02:50:28 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL User Conferences]]></category>
		<category><![CDATA[Percona Performance Conference 2009]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[database design]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1425</guid>
		<description><![CDATA[My final presentation during the 2009 MySQL Conference and Expo week was with the Percona Performance Conference on the topic of The Ideal Performance Architecture. My talk included discussions on Technology, Disk, Memory, Indexes, SQL and Data.
The Ideal Performance Architecture
View more presentations from Ronald Bradford.

Updated 09/18/09
you can now see video of the event at Percona [...]]]></description>
			<content:encoded><![CDATA[<p>My final presentation during the 2009 MySQL Conference and Expo week was with the <a href="http://conferences.percona.com">Percona Performance Conference</a> on the topic of <b>The Ideal Performance Architecture</b>. My talk included discussions on Technology, Disk, Memory, Indexes, SQL and Data.</p>
<div style="width:425px;text-align:left" id="__ss_1335437"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/ronaldbradford/the-ideal-performance-architecture?type=presentation" title="The Ideal Performance Architecture">The Ideal Performance Architecture</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=theidealperformancearchitecture-090423214147-phpapp02&#038;stripped_title=the-ideal-performance-architecture" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=theidealperformancearchitecture-090423214147-phpapp02&#038;stripped_title=the-ideal-performance-architecture" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/ronaldbradford">Ronald Bradford</a>.</div>
</div>
<p><b>Updated 09/18/09</b><br />
you can now see video of the event at <a href="http://www.percona.tv/performance/ronald-bradford-the-ideal-performance-architecture-ppc-2009">Percona TV</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronaldbradford.com/blog/percona-performance-conference-talk-2009-04-23/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
