<?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>ServerAdminBlog &#187; MySQL</title>
	<atom:link href="http://www.serveradminblog.com/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.serveradminblog.com</link>
	<description>Short Circuit...</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:56:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>FreeRadius install howto (4) &#8211; populating tables</title>
		<link>http://www.serveradminblog.com/2011/12/freeradius-install-howto-4-populating-tables/</link>
		<comments>http://www.serveradminblog.com/2011/12/freeradius-install-howto-4-populating-tables/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 23:45:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeRadius]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Networks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=315</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/12/freeradius-install-howto-4-populating-tables/' addthis:title='FreeRadius install howto (4) &#8211; populating tables '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>In the last article about FreeRadius (Here), I wrote about basic settings and now I&#8217;ll write something about inserting users into database (MySQL). The FreeRadius database schema contains several tables: nas This table contains data about NASes (radius clients) and it is a &#8220;replacement&#8221; for clients.conf file. It is much easier to maintain the clients [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/12/freeradius-install-howto-4-populating-tables/' addthis:title='FreeRadius install howto (4) &#8211; populating tables '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>In the last article about FreeRadius (<a href="http://www.serveradminblog.com/2011/03/freeradius-install-howto-3/">Here</a>), I wrote about basic settings and now I&#8217;ll write something about inserting users into database (MySQL).</p>
<p>The FreeRadius database schema contains several tables:</p>
<p><strong>nas</strong></p>
<p>This table contains data about NASes (radius clients) and it is a &#8220;replacement&#8221; for clients.conf file. It is much easier to maintain the clients in the database than inside config file. If you want to use database for NAS list, skip the step in the last howto (the part about clients.conf). Also, in case you want to keep your NASes in the nas table, you&#8217;ll need to uncomment the <strong>readclients = yes</strong> inside sql.conf.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">        # Set to 'yes' to read radius clients from the database ('nas' table)
        # Clients will ONLY be read on server startup.  For performance
        # and security reasons, finding clients via SQL queries CANNOT
        # be done &quot;live&quot; while the server is running.
        #
        readclients = yes</pre></div></div>

<p>As you can see from the comment, you will need to restart radiusd process to allow/disallow specific NAS.</p>
<p>nas table schema is located inside raddb/sql/mysql/nas.sql</p>
<p>To add IP 192.168.0.15 inside nas table, exec next query:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span>  nas <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>  <span style="color: #ff0000;">'192.168.0.15'</span><span style="color: #66cc66;">,</span>  <span style="color: #ff0000;">'myNAS'</span><span style="color: #66cc66;">,</span>  <span style="color: #ff0000;">'other'</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>  <span style="color: #ff0000;">'mysecret'</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>  <span style="color: #ff0000;">'RADIUS Client'</span>
<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>and you will have</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql&gt; select * from nas;
+----+--------------+-----------+-------+-------+----------+--------+-----------+---------------+
| id | nasname      | shortname | type  | ports | secret   | server | community | description   |
+----+--------------+-----------+-------+-------+----------+--------+-----------+---------------+
|  1 | 192.168.0.15 | myNAS     | other |  NULL | mysecret | NULL   | NULL      | RADIUS Client |
+----+--------------+-----------+-------+-------+----------+--------+-----------+---------------+
1 row in set (0.00 sec)</pre></div></div>

<p><strong>radacct</strong></p>
<p>This table is used for accounting data. In case you want to collect traffic stats, you will need to uncomment <strong>sql</strong> inside accounting {} section in <strong>/usr/local/etc/raddb/sites-available/default.</strong> The same table can be used for simultaneous use checking which is faster than radutmp. All you need to do is to uncomment <strong>sql</strong> inside session {} section inside <strong>/usr/local/etc/raddb/sites-available/default </strong>and uncomment <strong>simul_count_query</strong> inside <strong>/usr/local/etc/raddb/sql/mysql/dialup.conf</strong></p>
<p><strong>radcheck</strong></p>
<p>This table keeps the check attributes for users (User-Password, Cleartext-Password, Expiration, Simultaneous-Use, Auth-Type, &#8230;)</p>
<p><strong>radreply</strong></p>
<p>Is used for reply attributes for specific user. For example Framed-IP-Address, upload and download speed, etc&#8230;</p>
<p><strong>radgroupcheck</strong></p>
<p>This table keeps the check attributes for groups (which means, all users inside specific group will be checked against this attributes).</p>
<p><strong>radgroupreply</strong></p>
<p>The same like radreply but for groups. (all users in specific group will get the same speed, etc). Also, Framed-Pool attribute goes here.</p>
<p><strong>radpostauth</strong></p>
<p>This table is used for logging failed login attempts. To use this, you&#8217;ll need to uncomment sql inside postauth section (<strong>/usr/local/etc/raddb/sites-available/default.</strong>). Think twice before you enable this option because it can overload your server with constant inserts. Your customers will probably spend their money on wireless or wired routers so the logging attempts will come over and over.</p>
<p><strong>radusergroup</strong></p>
<p>This table keeps relation between username and specific group and group priority. In Freeradius 1.x this table was named &#8220;<strong>usergroup</strong>&#8221; so in case you have your own billing which is made for old schema, rename this table to <strong>usergroup</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">        # Table to keep group info
        usergroup_table = &quot;radusergroup&quot;</pre></div></div>

<p>Examples</p>
<p>We will create a sample service with the next attributes:<br />
- 512kbps download speed<br />
- 128kbps upload speed<br />
- we will use PPPoE – Point to Point Protocol Over Ethernet<br />
- we will assign dynamic IP addresses to our clients from &#8220;internet&#8221; IP pool</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`radgroupreply`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`groupname`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`attribute`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`op`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`value`</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testservice'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Ascend-Xmit-Rate'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'524288'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> 
<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testservice'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Ascend-Data-Rate'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'131072'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> 
<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testservice'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Framed-Pool'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'internet'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>As you can see the speed is converted to bps.</p>
<p><img src="http://www.serveradminblog.com/wp-content/uploads/2011/12/kreiranje-paketa.png" alt="" title="service" width="296" height="101" class="alignnone size-full wp-image-392" /></p>
<p>After you created the service, lets create a sample user (assigned with created service).</p>
<p>As I noticed above, check attributes should be placed inside radcheck table.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`radcheck`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`username`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`attribute`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`op`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`value`</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testuser'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'User-Password'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testpassword'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> 
<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testuser'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Simultaneous-Use'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'1'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>In this sample, the password is in plain text format which is not reccommended. Insted User-Password (which is alternative to Cleartext-Password for Mikrotik) better option is to use MD5-Password but keep in mind that you won&#8217;t be able to use CHAP.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`radcheck`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`username`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`attribute`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`op`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`value`</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testuser'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'MD5-Password'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> MD5<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'testpassword'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> 
<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testuser'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Simultaneous-Use'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'1'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><img src="http://www.serveradminblog.com/wp-content/uploads/2011/12/kreiranje-korisnika.png" alt="" title="kreiranje-korisnika" width="461" height="79" class="alignnone size-full wp-image-394" /></p>
<p>Then we need to assign this user with created service (group)</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`radusergroup`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`username`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`groupname`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`priority`</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'testuser'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testservice'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'1'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><img src="http://www.serveradminblog.com/wp-content/uploads/2011/12/uparivanje-korisnika.png" alt="" title="uparivanje-korisnika" width="215" height="48" class="alignnone size-full wp-image-396" /></p>
<p>After those inserts, lets test</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@ns2 raddb]# radtest testuser testpassword 127.0.0.1 0 testing123
Sending Access-Request of id 228 to 127.0.0.1 port 1812
        User-Name = &quot;testuser&quot;
        User-Password = &quot;testpassword&quot;
        NAS-IP-Address = 192.168.0.10
        NAS-Port = 0
        Message-Authenticator = 0x00000000000000000000000000000000
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=228, length=54
        Ascend-Xmit-Rate = 524288
        Ascend-Data-Rate = 131072
        Framed-Pool = &quot;internet&quot;
[root@ns2 raddb]#</pre></div></div>

<p>As you can see, the username/password combination is valid and RADIUS server returned all attributes assigned with user&#8217;s group. </p>
<p>To suspend user&#8217;s account you can insert Auth-Type := Reject for user.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`radcheck`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`username`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`attribute`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`op`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`value`</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testuser'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Auth-Type'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Reject'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>and we have</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@ns2 raddb]# radtest testuser testpassword 127.0.0.1 0 testing123
.....
rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=145, length=20</pre></div></div>

<p>Another option for disabling users is assigning with specific group which has Auth-Type := Reject inside radgroupcheck</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`radgroupcheck`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`groupname`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`attribute`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`op`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`value`</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'suspended'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Auth-Type'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Reject'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Assigning with suspended group can be done with</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`radusergroup`</span> 
<span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`groupname`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'suspended'</span> 
<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`username`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'testuser'</span> 
<span style="color: #993333; font-weight: bold;">AND</span> <span style="color: #ff0000;">`priority`</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span>;</pre></div></div>

<p><img src="http://www.serveradminblog.com/wp-content/uploads/2011/12/reject-grupe.png" alt="" title="reject-grupe" width="249" height="51" class="alignnone size-full wp-image-397" /></p>
<p>and we have</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=198, length=20</pre></div></div>

<p>Also, keep in mind that routers will try to connect again and again so you will have a big problems in case you have thousands of users. Another option is to assign users with specific group which doesn&#8217;t have Auth-Type attribute. Instead rejecting you can assign internal IPs and redirect them to suspended page.</p>
<p>Many questions on FreeRadius mailing list are about Simultaneus-Use. Solution to this problem is very simple and it is very rude to ask this question again and again&#8230; </p>
<p>All you need to do is to insert Simultaneous-Use := 1 for specific user (radcheck table) or inside radgroupcheck if you want to limit all users inside specific group.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`radgroupcheck`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`groupname`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`attribute`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`op`</span> <span style="color: #66cc66;">,</span><span style="color: #ff0000;">`value`</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'testservice'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Simultaneous-Use'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">':='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'1'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>In case you want to set Expiration attribute you can insert the date and the time inside radcheck table.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">INSERT INTO `radcheck` (`id` ,`username` ,`attribute` ,`op` ,`value` )
VALUES (NULL , 'testuser', 'Expiration', '==', 'November 30 2011 00:00:00');</pre></div></div>

<p>then we have</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@ns2 raddb]# radtest testuser testpassword 127.0.0.1 0 testing123
Sending Access-Request of id 28 to 127.0.0.1 port 1812
        User-Name = &quot;testuser&quot;
        User-Password = &quot;testpassword&quot;
        NAS-IP-Address = 192.168.0.10
        NAS-Port = 0
        Message-Authenticator = 0x00000000000000000000000000000000
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=28, length=60
        Ascend-Xmit-Rate = 524288
        Ascend-Data-Rate = 131072
        Framed-Pool = &quot;internet&quot;
        Session-Timeout = 670889</pre></div></div>

<p>You can note Session-Timeout attribute which contains the time in seconds between this moment and the date inside Expiration field. According to this value, the NAS will auto disconnect user when this time expire (in our case 670889 seconds). In case you set the time which already passed (for example yesterdays date) the user will be rejected. </p>
<p><strong>Please keep in mind that this date format works for Mikrotik. I didn&#8217;t have chance to test it with other NASes.</strong> </p>
<p>If you want to reconnect users at regular intervals (for example every 24 hours &#8211; 86400 seconds) you can insert Session-Timeout inside radreply table (because it isn&#8217;t check attribute).<br />
To recconect every user inside specific group, add this attribute inside radgroupreply table. </p>
<p>To assign a static IP for specific user insert Framed-IP-Address attribute inside radreply table where Value will be that IP address. Operator should be :=. </p>
<p>Please keep in mind that all inserts inside those tables are visible to radius server right after insert. Only inserts inside nas table won&#8217;t be until the restart (service radiusd restart)</p>
<p>I hope this post will help you to set up your own RADIUS server. Also, keep in mind that this is just an example and all this can done in many other ways. </p>
<p>In case you find a spelling errors please contact me so I can fix them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2011/12/freeradius-install-howto-4-populating-tables/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>MySQL Performance – Howto – part 2 (write cache dependance)</title>
		<link>http://www.serveradminblog.com/2011/12/mysql-performance-%e2%80%93-howto-%e2%80%93-part-2-write-cache-dependance/</link>
		<comments>http://www.serveradminblog.com/2011/12/mysql-performance-%e2%80%93-howto-%e2%80%93-part-2-write-cache-dependance/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 16:23:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=379</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/12/mysql-performance-%e2%80%93-howto-%e2%80%93-part-2-write-cache-dependance/' addthis:title='MySQL Performance – Howto – part 2 (write cache dependance) '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>I already wrote about Sysbench and MySQL tunning scripts. Those articles can be found HERE and HERE. Now lets do some tests and lets see the dependance from write cache enabled/disabled option on your disks. Keep in mind that RH based distros will probably disable write cache (I tried Ubuntu on this server and the [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/12/mysql-performance-%e2%80%93-howto-%e2%80%93-part-2-write-cache-dependance/' addthis:title='MySQL Performance – Howto – part 2 (write cache dependance) '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>I already wrote about Sysbench and MySQL tunning scripts. Those articles can be found <a href="http://www.serveradminblog.com/2010/02/sysbench-on-centos-howto/">HERE</a> and <a href="http://www.serveradminblog.com/2011/03/tuning-mysql-performance-howto-part-1/">HERE</a>. </p>
<p>Now lets do some tests and lets see the dependance from write cache enabled/disabled option on your disks. Keep in mind that RH based distros will probably disable write cache (I tried Ubuntu on this server and the same thing happen &#8211; write cache was disabled after installation). </p>
<p><span id="more-379"></span></p>
<p>The first step is to check the disk with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@s1 sysbench-0.4.12]# hdparm -i /dev/sda
&nbsp;
/dev/sda:
&nbsp;
 Model=GB0250EAFYK                             , FwRev=HPG1    , SerialNo=WCAT1E535427
 Config={ HardSect NotMFM HdSw&gt;15uSec SpinMotCtl Fixed DTR&gt;5Mbs FmtGapReq }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=50
 BuffType=unknown, BuffSize=16384kB, MaxMultSect=16, MultSect=?16?
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2
 AdvancedPM=no WriteCache=disabled
 Drive conforms to: unknown:  ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6 ATA/ATAPI-7</pre></div></div>

<p>Note <strong>WriteCache=disabled</strong> line</p>
<p>I suppose you know how to create a database, assign a user and set password</p>
<p>Read-write test for InnoDB</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># sysbench --num-threads=16 --max-requests=10000 --test=oltp --oltp-table-size=500000 --mysql-socket=/var/lib/mysql/mysql.sock --oltp-test-mode=complex --mysql-user=test_database --mysql-password=test_database_password run</pre></div></div>

<p>gave me the next results</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&nbsp;
No DB drivers specified, using mysql
Running the test with following options:
Number of threads: 16
&nbsp;
Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations,  1 pct of values are returned in 75 pct cases)
Using &quot;BEGIN&quot; for starting transactions
Using auto_inc on the id column
Maximum number of requests for OLTP test is limited to 10000
Threads started!
Done.
&nbsp;
OLTP test statistics:
    queries performed:
        read:                            140000
        write:                           50000
        other:                           20000
        total:                           210000
    transactions:                        10000  (42.63 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 190000 (809.95 per sec.)
    other operations:                    20000  (85.26 per sec.)
&nbsp;
Test execution summary:
    total time:                          234.5821s
    total number of events:              10000
    total time taken by event execution: 3751.1329
    per-request statistics:
         min:                                 17.33ms
         avg:                                375.11ms
         max:                               3850.27ms
         approx.  95 percentile:             766.79ms
&nbsp;
Threads fairness:
    events (avg/stddev):           625.0000/1.73
    execution time (avg/stddev):   234.4458/0.08</pre></div></div>

<p><strong>The total time is more than 234 seconds which is terrible result.</strong> </p>
<p>Now, delete sbtest table and recreate it again (please see the sysbench howto). </p>
<p>Enable write cache with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># hdparm -W1 /dev/sda</pre></div></div>

<p>and start test again</p>
<p>The result is</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">No DB drivers specified, using mysql
Running the test with following options:
Number of threads: 16
&nbsp;
Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations,  1 pct of values are returned in 75 pct cases)
Using &quot;BEGIN&quot; for starting transactions
Using auto_inc on the id column
Maximum number of requests for OLTP test is limited to 10000
Threads started!
Done.
&nbsp;
OLTP test statistics:
    queries performed:
        read:                            140000
        write:                           50000
        other:                           20000
        total:                           210000
    transactions:                        10000  (621.08 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 190000 (11800.43 per sec.)
    other operations:                    20000  (1242.15 per sec.)
&nbsp;
Test execution summary:
    total time:                          16.1011s
    total number of events:              10000
    total time taken by event execution: 255.8624
    per-request statistics:
         min:                                  2.49ms
         avg:                                 25.59ms
         max:                                689.84ms
         approx.  95 percentile:              41.84ms
&nbsp;
Threads fairness:
    events (avg/stddev):           625.0000/4.68
    execution time (avg/stddev):   15.9914/0.03</pre></div></div>

<p><strong>Now we have a 16.1011 seconds for a complete test. </strong> I repeated the test several time with the same results. </p>
<p>We have a 14.62 times better result.</p>
<p>It is obvious that write cache is very important for MySQL but keep in mind that something can be lost in case of power failure and you should think about battery backups. </p>
<p><strong>Tuning Kernel parameters</strong></p>
<p>It is good idea to tune a few kernel parameters too. For this purpose you can install ktune (yum install ktune). (more info https://fedorahosted.org/ktune/)</p>
<p>With &#8220;service ktune start&#8221; you will set up scheduler on deadline instead of cfq (which can be up to 20% slower)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@s1 bekap]# service ktune start
Applying ktune sysctl settings:
/etc/sysctl.ktune:                                         [  OK  ]
Applying sysctl settings from /etc/sysctl.conf:            [  OK  ]
Applying deadline elevator: sda                            [  OK  ]</pre></div></div>

<p>After Ktune I have a little faster time (around 15 seconds)</p>
<p>More info about disk elevators can be found here <a href="http://www.redhat.com/magazine/008jun05/features/schedulers/" target="_blank">http://www.redhat.com/magazine/008jun05/features/schedulers/</a></p>
<p><strong>Optimizing the EXT3 file system on CentOS</strong></p>
<p>noatime<br />
This mount option tells the system not to update inode access times. This is a good option for web servers, news servers or other uses with high access file systems.</p>
<p>Open  /etc/fstab and add noatime like shown below</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/dev/VolGroup00/LogVol00 /                       ext3    defaults,noatime        1 1</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2011/12/mysql-performance-%e2%80%93-howto-%e2%80%93-part-2-write-cache-dependance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test your sql skills online</title>
		<link>http://www.serveradminblog.com/2011/08/test-your-sql-skills-online/</link>
		<comments>http://www.serveradminblog.com/2011/08/test-your-sql-skills-online/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 14:16:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=347</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/08/test-your-sql-skills-online/' addthis:title='Test your sql skills online '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Very nice 5 questions quiz about SQL performance http://use-the-index-luke.com/3-minute-test/]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/08/test-your-sql-skills-online/' addthis:title='Test your sql skills online '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Very nice 5 questions quiz about SQL performance</p>
<p><a href="http://use-the-index-luke.com/3-minute-test/" target="_blank">http://use-the-index-luke.com/3-minute-test/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2011/08/test-your-sql-skills-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Performance &#8211; Howto &#8211; part 1 (high performance tuning scripts)</title>
		<link>http://www.serveradminblog.com/2011/03/tuning-mysql-performance-howto-part-1/</link>
		<comments>http://www.serveradminblog.com/2011/03/tuning-mysql-performance-howto-part-1/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 09:24:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=40</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/03/tuning-mysql-performance-howto-part-1/' addthis:title='MySQL Performance &#8211; Howto &#8211; part 1 (high performance tuning scripts) '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Often the server admin has little control over the applications which uses MySQL and it is hard to find the bottlenecks. This blog post can&#8217;t bring the peace in the world, or help NASA to finally land on the Mars. Instead those tasks, I&#8217;ll try to solve something else and present my own experiences with [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/03/tuning-mysql-performance-howto-part-1/' addthis:title='MySQL Performance &#8211; Howto &#8211; part 1 (high performance tuning scripts) '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Often the server admin has little control over the applications which uses MySQL and it is hard to find the bottlenecks. This blog post can&#8217;t bring the peace in the world, or help NASA to finally land on the Mars. Instead those tasks, I&#8217;ll try to solve something else and present my own experiences with MySQL storage engines (at least for MyISAM and InnoDB as the most popular).<br />
<span id="more-40"></span></p>
<p>Keep in mind that I&#8217;m not an expert in this field. When I have problems with MySQL, I dig with my both hands (and head) to solve them without casualties. Every app has its own queries and you&#8217;ll need to track them down via slow query log. </p>
<p>Before you do anything, keep in mind that default MySQL installation usually works fine. Unfortunately maximum performances can&#8217;t be achieved without adjustments to increase performance and stability.</p>
<p>Before you can do anything, you need to enable slow query log. </p>
<p>Exec</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># touch /var/log/slow-query.log</pre></div></div>

<p>to create slow-query.log file. Then add</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">log-slow-queries = /var/log/slow-query.log
long_query_time = 4
log-queries-not-using-indexes</pre></div></div>

<p>(for MySQL 5.0.x)</p>
<p>to /etc/my.cnf (inside [mysqld] section) and restart mysql. Wait at least 24-48 hours before you proceed to the next step. </p>
<p>(For MySQL 5.1.x check here: <a href="http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html">LINK</a>)</p>
<p><strong>High performance tuning scripts</strong></p>
<p><strong>Mysqltuner</strong></p>
<p>MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># wget mysqltuner.pl
# chmod +x mysqltuner.pl
# ./mysqltuner.pl</pre></div></div>

<p>Read output and try to follow the recommendations.</p>
<p><strong>Tuning-primer</strong></p>
<p>Tuning-primer is another script who takes information from &#8220;SHOW STATUS LIKE&#8230;&#8221; and &#8220;SHOW VARIABLES LIKE&#8230;&#8221; to produce readable recommendations for tuning server variables.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># wget http://www.day32.com/MySQL/tuning-primer.sh
# ./tuning-primer.sh</pre></div></div>

<p>Also, read output and try to see what you can do to fix problems. Keep in mind that you need to restart mysql after you add something to /etc/my.cnf. In case something goes wrong, check mysql log (usually /var/log/mysqld.log</p>
<p><strong>MyTOP</strong></p>
<p>Mytop is a console-based (non-gui) tool for monitoring the threads and overall performance of a MySQL</p>
<p>To install mytop,</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
# tar -xvzf mytop-1.6.tar.gz
# cd mytop-1.6
# perl Makefile.PL
# make
# make install</pre></div></div>

<p>In case some Perl libraries are missing, you should install them via cpan.</p>
<p>For example, Term::ReadKey is required and you can get it via cpan.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># cpan
(pres Enter several times until you get cpan shell)
cpan&gt; install Term::ReadKey
cpan&gt; quit</pre></div></div>

<p>Usage: # mytop -d DATABASE -u USERNAME -p PASSWORD</p>
<p>(replace the DATABASE, USERNAME and PASSWORD with your parameters. </p>
<p><strong>MySQLReport</strong></p>
<p>mysqlreport makes a friendly report of important MySQL status values. mysqlreport transforms the values from SHOW STATUS into an easy-to-read report that provides an in-depth understanding of how well MySQL is running. mysqlreport is a better alternative (and practically the only alternative) to manually interpreting SHOW STATUS.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># wget http://hackmysql.com/mysqlreport
# chmod +x mysqlreport
# ./mysqlreport --user root --password</pre></div></div>

<p>Enter password for root and check output. More info can be found here. <a href="http://hackmysql.com/mysqlreport">LINK</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2011/03/tuning-mysql-performance-howto-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL &#8211; Update one table from another</title>
		<link>http://www.serveradminblog.com/2011/01/mysql-update-one-table-from-another/</link>
		<comments>http://www.serveradminblog.com/2011/01/mysql-update-one-table-from-another/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 12:38:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=235</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/01/mysql-update-one-table-from-another/' addthis:title='MySQL &#8211; Update one table from another '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>If you need to update one table with information from another table, you can use next query. UPDATE sourceTable s, destTable d SET d.something = s.something WHERE d.fieldId = s.id]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/01/mysql-update-one-table-from-another/' addthis:title='MySQL &#8211; Update one table from another '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>If you need to update one table with information from another table, you can use next query.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> sourceTable s<span style="color: #66cc66;">,</span> destTable d
<span style="color: #993333; font-weight: bold;">SET</span> d<span style="color: #66cc66;">.</span>something <span style="color: #66cc66;">=</span> s<span style="color: #66cc66;">.</span>something
<span style="color: #993333; font-weight: bold;">WHERE</span> d<span style="color: #66cc66;">.</span>fieldId <span style="color: #66cc66;">=</span> s<span style="color: #66cc66;">.</span>id</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2011/01/mysql-update-one-table-from-another/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reducing ibdata1 &#8211; howto</title>
		<link>http://www.serveradminblog.com/2010/12/reducing-ibdata1-howto/</link>
		<comments>http://www.serveradminblog.com/2010/12/reducing-ibdata1-howto/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 12:54:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=221</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/12/reducing-ibdata1-howto/' addthis:title='Reducing ibdata1 &#8211; howto '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>One of the biggest mistakes you can make with MySQL is to leave its default configuration. It will work, but not as it should. For example, default MySQL installation (5.0x) will keep all InnoDB data in one file &#8211; ibdata1. This file is usually located in /var/lib/mysql (at least on RH and Debian based distros) [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/12/reducing-ibdata1-howto/' addthis:title='Reducing ibdata1 &#8211; howto '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>One of the biggest mistakes you can make with MySQL is to leave its default configuration. It will work, but not as it should. </p>
<p>For example, default MySQL installation (5.0x) will keep all InnoDB data in one file &#8211; ibdata1. This file is usually located in /var/lib/mysql (at least on RH and Debian based distros) and after few months this file can became very big (in my case it was 20GB). This file has a initial size of 10Mb and it automatically extends but it can’t be reduced with DELETE, TRUNCATE or DROP. The file could reach the maximum size allowed by the filesystem if no limit is set in the my.cnf file (Debian/Ubuntu -/etc/mysql/my.cnf or RH based distros /etc/my.cnf). The best idea is to force MySQL to create an ibd file for each InnoDB table (add <em>innodb_file_per_table</em> in my.cnf and restart mysql). Unf. this won&#8217;t affect old tables which are already created and which are in use. </p>
<p>You can &#8220;FIX&#8221; this on several ways but no matter what option do you choose, BACKUP YOUR WHOLE MYSQL DATA DIRECTORY and stop services connected to your MySQL server (httpd, radius, postfix, dovecot, etc).</p>
<p>Keep in mind that converting InnoDB table to MyISAM will kill foreign keys so do not do it unless you know how to recreate your foreign keys. </p>
<p>The best option is to dump all your databases in one sql file. </p>
<p><strong>Step 1</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"># <span style="color: #66cc66;">/</span>usr<span style="color: #66cc66;">/</span>bin<span style="color: #66cc66;">/</span>mysqldump ––extended<span style="color: #66cc66;">-</span><span style="color: #993333; font-weight: bold;">INSERT</span> ––all<span style="color: #66cc66;">-</span><span style="color: #993333; font-weight: bold;">DATABASES</span> ––add<span style="color: #66cc66;">-</span>drop<span style="color: #66cc66;">-</span><span style="color: #993333; font-weight: bold;">DATABASE</span> ––disable<span style="color: #66cc66;">-</span><span style="color: #993333; font-weight: bold;">KEYS</span> ––flush<span style="color: #66cc66;">-</span>privileges ––quick ––routines ––triggers <span style="color: #66cc66;">&gt;</span> backup<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">SQL</span></pre></div></div>

<p><strong>Step 2</strong></p>
<p>Stop mysql server with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># service mysqld stop</pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/init.d/mysqld stop</pre></div></div>

<p><strong>Step 3</strong></p>
<p>Backup complete mysql data dir (/var/lib/mysql).</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># cd /var/lib/
# mv mysql mysql_backup
# mkdir mysql
# chown mysql:mysql mysql</pre></div></div>

<p>Then you should have something like</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">drwxr-xr-x  5 mysql     mysql     4096 2010-12-30 13:38 mysql</pre></div></div>

<p><strong>Step 4</strong></p>
<p>Add <em>innodb_file_per_table</em> option in /etc/my.cnf file and save file</p>
<p><strong>Step 5</strong></p>
<p>Re-initialize the database with the following commands</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># su mysql
$ mysql_install_db
$ exit</pre></div></div>

<p><strong>Step 6</strong></p>
<p>Start mysql server with <em>service mysqld start</em> and get into mysql console with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mysql -u root</pre></div></div>

<p>Then exec next commands</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span>;
<span style="color: #993333; font-weight: bold;">SOURCE</span> backup<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">SQL</span>;
<span style="color: #993333; font-weight: bold;">SET</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span>;</pre></div></div>

<p><strong>Step 7</strong></p>
<p>Restart mysql server with <em>service mysqld restart</em></p>
<p>That should be all. </p>
<p>In case that something goes wrong you still have mysql_backup dir which contains all you databases and files. Simple rename the new mysql dir to mysql_new and mysql_backup to mysql. Then restart mysql.</p>
<p>Keep in mind that this operation will kill all services who depends on mysql. So, be quick <img src='http://www.serveradminblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Also, good idea is to execute command mysql_secure_installation which will &#8220;tight&#8221; your MySQL server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/12/reducing-ibdata1-howto/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Manual MySQL update on RHEL/CentOS</title>
		<link>http://www.serveradminblog.com/2010/09/manual-mysql-update-on-rhelcentos/</link>
		<comments>http://www.serveradminblog.com/2010/09/manual-mysql-update-on-rhelcentos/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 09:37:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=30</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/09/manual-mysql-update-on-rhelcentos/' addthis:title='Manual MySQL update on RHEL/CentOS '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>If you&#8217;re using RH based distros, you&#8217;ll probably notice that their habbit is to keep the same software versions in one release.  For example, if you need PHP on CentOS 5.x, # yum install php will install PHP 5.1.6  (Latest PHP version available on http://php.net is 5.3.x).  If you need MySQL, you can count on [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/09/manual-mysql-update-on-rhelcentos/' addthis:title='Manual MySQL update on RHEL/CentOS '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>If you&#8217;re using RH based distros, you&#8217;ll probably notice that their habbit is to keep the same software versions in one release.  For example, if you need PHP on CentOS 5.x, <strong><em># yum install php</em></strong> will install PHP 5.1.6  (Latest PHP version available on <a href="http://php.net" target="_blank">http://php.net</a> is 5.3.x).  If you need MySQL, you can count on MySQL 5.0.xx branch and any other wishes will force you to use independent repos (like <a href="http://www.jasonlitka.com/yum-repository/" target="_blank">http://www.jasonlitka.com/yum-repository/</a>). Another option is to use  &#8220;do-it-yourself&#8221; method.</p>
<p>In this post I&#8217;ll write about manual upgrade steps from rpm archives. Please keep in mind that this procedure works for me and please do not send me the private messages. I can&#8217;t help you on that way. Only options is to post your comments here and I will try to solve your problem(s).</p>
<p>First thing you need to do is to see what mysql packages do you have installed</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># rpm -qa | grep -i ^mysql</pre></div></div>

<p>You will get something like</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql-connector-odbc-3.51.12-2.2
mysql-5.0.77-4.el5_5.3
MySQL-python-1.2.1-1
mysql-server-5.0.77-4.el5_5.3
mysql-devel-5.0.77-4.el5_5.3
mysql-bench-5.0.77-4.el5_5.3</pre></div></div>

<p>Then backup all your databases, save them on the safe location, protect with alarms, guards, poison dogs, cobras, ninjas, etc&#8230; </p>
<p>Download rpms from http://www.mysql.com/downloads/mysql/ (MySQL-client-community-5.1.50-1.rhel5.i386.rpm, MySQL-devel-community-5.1.50-1.rhel5.i386.rpm, MySQL-server-community-5.1.50-1.rhel5.i386.rpm, MySQL-shared-community-5.1.50-1.rhel5.i386.rpm)</p>
<p>Note: if you have 32-bit OS, download i386 rpms, if you have 64bit download x86_64 rpms)</p>
<p>Stop mysql server with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># service mysqld stop</pre></div></div>

<p>Then remove mysql rpms but with &#8211;nodeps option (in case you use yum remove mysql, you will need to reinstall a lot of apps because they will be deleted too)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># rpm -e --nodeps mysql</pre></div></div>

<p>Repeat the same with other mysql packages (devel, bench, client,&#8230;). Then you need to install downloaded rpms with rpm -i mysql&#8230; and do it. </p>
<p>It is possible to receive the errors like</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ls: /var/lib/mysql/*.err: No such file or directory
ls: /var/lib/mysql/*.err: No such file or directory
ERROR: 1136  Column count doesn't match value count at row 1
100910 10:24:00 [ERROR] Aborting
&nbsp;
100910 10:24:00 [Note] /usr/sbin/mysqld: Shutdown complete
&nbsp;
Installation of system tables failed!  Examine the logs in /var/lib/mysql for more information.</pre></div></div>

<p>This will be fixed later&#8230; </p>
<p>Now you need to add .my.cnf file to your root dir so you can execute mysql_upgrade command (note that . before m means that file is hidden). Add next lines inside this file (and don&#8217;t forget to replace rootpass with your real mysql root pass)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[client]
user=root
password=rootpass</pre></div></div>

<p>(chmod .my.cnf to 600 for security reasons)</p>
<p>Then exec next command</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># service mysql start</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mysql_upgrade</pre></div></div>

<p>This will produce the similar output</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
Running 'mysqlcheck with default connection arguments
blabla.table1                            OK
blabla.table2                             OK
blabla.table3                                OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log
Error    : You can't use locks with log tables.
status   : OK
mysql.help_category
error    : Table upgrade required. Please do &quot;REPAIR TABLE `help_category`&quot; or dump/reload to fix it!
mysql.help_keyword
error    : Table upgrade required. Please do &quot;REPAIR TABLE `help_keyword`&quot; or dump/reload to fix it!
mysql.help_relation                                OK
database2.cache
error    : Table upgrade required. Please do &quot;REPAIR TABLE `cache`&quot; or dump/reload to fix it!
database2.contacts                             OK
database2.identities                           OK
database2.messages
error    : Table upgrade required. Please do &quot;REPAIR TABLE `messages`&quot; or dump/reload to fix it!
database2.session
error    : Table upgrade required. Please do &quot;REPAIR TABLE `session`&quot; or dump/reload to fix it!
database2.users
error    : Table upgrade required. Please do &quot;REPAIR TABLE `users`&quot; or dump/reload to fix it!
&nbsp;
Repairing tables
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_topic                                   OK
mysql.proc                                         OK
mysql.time_zone_name                               OK
database2.cache
note     : The storage engine for the table doesn't support repair
database2.messages
note     : The storage engine for the table doesn't support repair
database2.session
note     : The storage engine for the table doesn't support repair
database2.users
note     : The storage engine for the table doesn't support repair
Running 'mysql_fix_privilege_tables'...
OK</pre></div></div>

<p>As you can see, the database database2 can&#8217;t be repaired and you should drop all tables inside this database and import your backup. After this, you can check is everything ok with <strong><em>mysql_upgrade &#8211;force</em></strong></p>
<p>Once again, restart mysql with service mysql restart and check logs. Test is everything ok, try ti create a new database, optimize your installation, eat something&#8230;  </p>
<p><strong>Note:</strong><br />
I had a lot of problems with this upgrade. I had to upgrade PHP to 5.3.x, I had to recompile postfix with MySQL support, I had to download and recompile Dovecot because Dovecot from CentOS repos is compiled with mysql 5.0 branch. Some versions of RoundCube doesn&#8217;t work with php 5.3.x so you should download latest, etc etc&#8230; It can be done but please be careful with this. Who knows which nuclear reactor will explode after this <img src='http://www.serveradminblog.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/09/manual-mysql-update-on-rhelcentos/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MySQL Workbench</title>
		<link>http://www.serveradminblog.com/2010/06/mysql-workbench/</link>
		<comments>http://www.serveradminblog.com/2010/06/mysql-workbench/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 08:54:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=113</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/06/mysql-workbench/' addthis:title='MySQL Workbench '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>MySQL Workbench is a cross-platform, visual database design tool developed by MySQL. It is the highly anticipated successor application of the DBDesigner4 project. MySQL Workbench will be available as a native GUI tool on Window, Linux and OS X. MySQL Workbench 5.2 RC provides: 1. Data Modeling 2. Query (upgrade from MySQL Query Browser) 3. [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/06/mysql-workbench/' addthis:title='MySQL Workbench '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>MySQL Workbench is a cross-platform, visual database design tool developed by MySQL. It is the highly anticipated successor application of the DBDesigner4 project. MySQL Workbench will be available as a native GUI tool on Window, Linux and OS X. </p>
<p>MySQL Workbench 5.2 RC provides:<br />
   1. Data Modeling<br />
   2. Query (upgrade from MySQL Query Browser)<br />
   3. Admin (upgrade from MySQL Administrator)</p>
<p>Please get your copy from <a href="http://dev.mysql.com/downloads/workbench/" target="_blank">this page</a></p>
<p><img class="aligncenter" title="MySQL WB" src="http://i5.photobucket.com/albums/y157/mangia/ostalo/wb_diagam_fk_highlight1.png" alt="" width="319" height="250" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/06/mysql-workbench/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo recover MySQL root password</title>
		<link>http://www.serveradminblog.com/2010/04/howto-recover-mysql-root-password/</link>
		<comments>http://www.serveradminblog.com/2010/04/howto-recover-mysql-root-password/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 16:53:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=74</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/04/howto-recover-mysql-root-password/' addthis:title='HowTo recover MySQL root password '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>By default, MySQL Server will be installed with root superuser without any password. You can connect to MySQL server as root without requiring password or by keying in blank password. However, if you have set the password for root and forget or unable to recall the password, then you will need to reset the root [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/04/howto-recover-mysql-root-password/' addthis:title='HowTo recover MySQL root password '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>By default, MySQL Server will be installed with root superuser without any password. You can connect to MySQL server as root without requiring password or by keying in blank password. However, if you have set the password for root and forget or unable to recall the password, then you will need to reset the root password for MySQL. </p>
<p>Step 1 is to stop MySQL service with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/init.d/mysql stop</pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># service mysqld stop</pre></div></div>

<p>Step 2 is to start MySQL w/o root password</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mysqld_safe --skip-grant-tables &amp;</pre></div></div>

<p>Step 3 is to connect with mysql client </p>
<pre lan="text">
# mysql -u root
</pre>
<p>Step 4 is to finally change old root password with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql&gt; use mysql;
mysql&gt; update user set password=PASSWORD(&quot;NEW-ROOT-PASSWORD&quot;) where User='root';
mysql&gt; flush privileges;
mysql&gt; quit</pre></div></div>

<p>Step 5 is to stop mysql server and restart it without &#8211;skip-grant-tables parameter</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/init.d/mysql stop</pre></div></div>

<p>Step 6 is to start mysql server and test it with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/init.d/mysql start
# mysql -u root -p</pre></div></div>

<p><strong>Note:</strong></p>
<p>After you install your new server, it is very good idea to improve the security of your MySQL installation with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mysql_secure_installation</pre></div></div>

<p>With mysql_secure_installation wizard you can set a password for root account, you can remove root accounts that are accessible from outside the local host, you can remove anonymous-user accounts and you can remove the test database, which by default can be accessed by anonymous users. The script will prompt you to determine which actions to perform. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/04/howto-recover-mysql-root-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SysBench on CentOS &#8211; HowTo</title>
		<link>http://www.serveradminblog.com/2010/02/sysbench-on-centos-howto/</link>
		<comments>http://www.serveradminblog.com/2010/02/sysbench-on-centos-howto/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 14:44:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=42</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/02/sysbench-on-centos-howto/' addthis:title='SysBench on CentOS &#8211; HowTo '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>If you want to test server performance, you can think about SysBench. SysBench is a modular, cross-platform and multi-threaded benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load. The idea of this benchmark suite is to quickly get an impression about system performance without setting up [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/02/sysbench-on-centos-howto/' addthis:title='SysBench on CentOS &#8211; HowTo '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>If you want to test server performance, you can think about SysBench. SysBench is a modular, cross-platform and multi-threaded benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load. The idea of this benchmark suite is to quickly get an impression about system performance without setting up complex database benchmarks or even without installing a database at all. </p>
<p>Current features allow to test the following system parameters:</p>
<p>    * file I/O performance<br />
    * scheduler performance<br />
    * memory allocation and transfer speed<br />
    * POSIX threads implementation performance<br />
    * database server performance (OLTP benchmark)<br />
(Primarily written for MySQL server benchmarking, SysBench will be further extended to support multiple database backends, distributed benchmarks and third-party plug-in modules)</p>
<p>I couldn&#8217;t find CentOS RPM so here are few tips how to install it manually.</p>
<p>Download Sysbench (current version is 0.4.12)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># wget http://garr.dl.sourceforge.net/sourceforge/sysbench/sysbench-0.4.12.tar.gz</pre></div></div>

<p>Then unpack it and install with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># tar -xvzf sysbench-0.4.12.tar.gz
# cd sysbench-0.4.12
# libtoolize --force --copy 
# ./autogen.sh
# ./configure
# make
# make install</pre></div></div>

<p>To test CPU performance you can try</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># sysbench --test=cpu --cpu-max-prime=20000 run</pre></div></div>

<p>For MySQL test, you&#8217;ll need to prepare database for testing with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># sysbench --test=oltp --mysql-table-engine=innodb --oltp-table-size=500000 --mysql-user=test_database --mysql-password=test_database_password --mysql-socket=/var/lib/mysql/mysql.sock prepare</pre></div></div>

<p>(replace test_database with valid username and test_database_password with valid password)</p>
<p>This command will create sample table inside test_database and it will have 500 000 rows (InnoDB engine).</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sysbench 0.4.12:  multi-threaded system evaluation benchmark
&nbsp;
No DB drivers specified, using mysql
Creating table 'test-database'...
Creating 500000 records in table 'test-database'...</pre></div></div>

<p>Now to start read test</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># sysbench --num-threads=16 --max-requests=100000 --test=oltp --oltp-table-size=500000 --mysql-socket=/var/lib/mysql/mysql.sock --oltp-read-only --mysql-user=test_database --mysql-password=test_database_password run</pre></div></div>

<p>For read-write test you can try</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># sysbench --num-threads=16 --max-requests=10000 --test=oltp --oltp-table-size=500000 --mysql-socket=/var/lib/mysql/mysql.sock --oltp-test-mode=complex --mysql-user=test_database --mysql-password=test_database_password run</pre></div></div>

<p>More info about specific parameters can be found in official docs (<a href="http://sysbench.sourceforge.net/docs/">http://sysbench.sourceforge.net/docs/</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/02/sysbench-on-centos-howto/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

