24 January 2013

How to Install MySQL on a Windows Server

Install MySQL on a Windows Server

The following article explains how to install MySQL on a Windows Server. The process involves downloading the latest version of MySQL directly to your Windows server and then installing the software. MySQL is a free product. Once installed, you may begin creating and using MySQL databases on your server.

To install MySQL, please follow these steps:

  1. Log into your server through Terminal Services or Remote Desktop Connection.
  2. Open a Web browser and load http://dev.mysql.com/downloads/
  3. Download Windows (x86) ZIP/Setup.exe (there's no need to sign up.  It is a free download).
  4. Unzip the file you downloaded above and run Setup.exe. 
  5. Click Next to begin the installation wizard.
  6. MySQL Installation
  7. Accept the License Agreement and click Next.
  8. MySQL Installation
  9. Select Typical Installation and click Next.
  10. MySQL Installation
  11. Click Install. The installation will take a few moments.
  12. MySQL Installation
  13. Click Next until you reach the Wizard Completed screen.
  14. Check Configure the MySQL Server now and click Finish.
  15. MySQL Installation
  16. Click Next to begin the MySQL Server Instance Configuration Wizard.
  17. MySQL Installation
  18. Select Detailed Configuration and click Next.
  19. Select Server Machine and click Next.
  20. Select Multifunctional Database and click Next.
  21. For InnoDB Tablespace Settings, leave the default settings and click Next.
  22. Select Online Transaction Processing (OLTP) and click Next.
  23. Check Enable TCP/IP Networking, leave the default Port Number and click Next.
  24. Select Standard Character Set and click Next.
  25. Check Install as Windows Service, uncheck Include BIN directory in Windows PATH and click Next.
  26. Enter a password for your root user, uncheck Create an Anonymous Account and click Next.
  27. Click Execute to complete the installation.

13 March 2012

JQuery Auto Complete Box

JQuery Auto Complete Box

$('#query').autocomplete(options) now returns an Autocomplete instance only for the first matched element.

Autocomplete functionality can be disabled or enabled programmatically.
var ac = $('#query').autocomplete(options);
ac.disable();
ac.enable();


Options can be changed programmatically at any time, only options that are passed get set:
ac.setOptions({ zIndex: 1001 });

If you need to pass additional parameters, you can set them via setOptions too:
ac.setOptions({ params: { first:'John', last:'Doe' } });

New parameters when initializing autocomplete. They can also be set via setOptions.

- zIndex: default value is 9999.

- fnFormatResult: function that formats values that are displayed in the autosuggest list. It takes three parameters: suggested value, data and current query value. Default function for this:
var reEscape = new RegExp('(\\' + ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'].join('|\\') + ')', 'g');

function fnFormatResult(value, data, currentValue) {
var pattern = '(' + currentValue.replace(reEscape, '\\$1') + ')';
return value.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
}




Installation:

Include jQuery in your header. After its included, add autocomplete script.
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.autocomplete.js"></script>




How to Use:

Here is an Ajax Autocomplete sample for the text field with id "query"
<input type="text" name="q" id="query" />

Create an instance of the Autocomplete object. You can have multiple instances on a single page.

Important: Autocomplete must be initialized after DOM has finished loading. Otherwise you will get an error in IE.
var options, a;
jQuery(function(){
options = { serviceUrl:'service/autocomplete.ashx' };
a = $('#query').autocomplete(options);
});


You can add extra options:
var a = $('#query').autocomplete({
serviceUrl:'service/autocomplete.ashx',
minChars:2,
delimiter: /(,|;)\s*/, // regex or character
maxHeight:400,
width:300,
zIndex: 9999,
deferRequestBy: 0, //miliseconds
params: { country:'Yes' }, //aditional parameters
noCache: false, //default is false, set to true to disable caching
// callback function:
onSelect: function(value, data){ alert('You selected: ' + value + ', ' + data); },
// local autosugest options:
lookup: ['January', 'February', 'March', 'April', 'May'] //local lookup values
});


Use lookup option only if you prefer to inject an array of autocompletion options, rather than sending Ajax queries.

Web page that provides data for Ajax Autocomplete, in our case autocomplete.ashx will receive GET request with querystring ?query=Li, and it must return JSON data in the following format:
{
query:'Li',
suggestions:['Liberia','Libyan Arab Jamahiriya','Liechtenstein','Lithuania'],
data:['LR','LY','LI','LT']
}


Notes:
query - original query value
suggestions - comma separated array of suggested values
data (optional) - data array, that contains values for callback function when data is selected.



Styling:

Script generates the following HTML (sample query Li). Active element when you navigate up and down is marked with class "selected". You can style it any way you wish.
<div class="autocomplete-w1">
<div style="width:299px;" id="Autocomplete_1240430421731" class="autocomplete">
<div><strong>Li</strong>beria</div>
<div><strong>Li</strong>byan Arab Jamahiriya</div>
<div><strong>Li</strong>echtenstein</div>
<div class="selected"><strong>Li</strong>thuania</div>
</div>
</div>


Here is style used in the sample above:
.autocomplete-w1 { background:url(img/shadow.png) no-repeat bottom right; position:absolute; top:0px; left:0px; margin:6px 0 0 6px; /* IE6 fix: */ _background:none; _margin:1px 0 0 0; }
.autocomplete { border:1px solid #999; background:#FFF; cursor:default; text-align:left; max-height:350px; overflow:auto; margin:-6px 6px 6px -6px; /* IE6 specific: */ _height:350px; _margin:0; _overflow-x:hidden; }
.autocomplete .selected { background:#F0F0F0; }
.autocomplete div { padding:2px 5px; white-space:nowrap; overflow:hidden; }
.autocomplete strong { font-weight:normal; color:#3399FF; }


If you will use this CSS, please make sure to correct path to the shadow.png image. Image is included in the package. It uses CSS Drop Shadow technique by Sergio Villarreal.

Popular Posts



www.Java2Hari.blogspot.com. Powered by Blogger.

 
Design by Java2Hari | Bloggerized by Free Blogger Templates | Free Downloads