PHP VS ASP.NET - The Databases.


If you have gone through my previous post, you should now have both php and asp.net running on your windows machine, it’s time to go on further. I’m going to setup both MySQL and SQL Server 2000 on this machine.

MySQL
I’ve got a lot of experiences for php and mysql on my Debian box, installation was hassle-free with Debian package manager. Now on windows, let’s see what can it be. First thing first, get your copy of MySQL windows installer at MySQL download page. Choose the Windows Essentials installer package to download. Go with the standard installation, provide a root password for the new MySQL instance.

Now we need a client tool, to connect to the database and perform desired tasks. For MySQL, there’s only one client tool I’m going to recommend, that is phpMyAdmin for sure. You can download the latest version at their download page. As you can tell, phpMyAdmin is script written in PHP, designed to assist users with daily database administrative tasks. I needed some extra configurations in order to make phpmyadmin work on my windows.

Problem is, the php installation in my last post was a standard installation. The windows installer version of php does not have extensions bundled in the distribution. I downloaded the full zip package, and copied the “ext” folder inside to C:\Program Files\PHP\. Remember also to copy all the *.dll files(normally starting with libxxxx.dll” inside the main folder from the extracted zip file, into C:\Program Files\PHP\.

Now it’s time to enable some extensions for php. In C:\Program Files\PHP\ , there’s a php.ini file. This file is used by php for configuration settings. Find the value extension_dir, and set the whole line to extension_dir=C:Program FilesPHPext. Remember NOT TO “QUOTE” the path as the predefined value it has. Now remove the comment mark ‘ ; ‘ of following lines.

  1. extension=php_mbstring.dll
  2. extension=php_mcrypt.dll
  3. extension=php_mysql.dll
  4. extension=php_mysqli.dll

These are the extentions needed to run phpMyAdmin. Now extract the package you got from phpMyAdmin download page, and place it in C:\inetpub\wwwroot. Rename the folder to something with shorter name, like “pma” or some sort. Go inside the renamed folder, and change the file config.sample.inc.php to config.inc.php. Edit the file, fill in the value for $cfg[’blowfish_secret’] with some random strings of your choice, and save. Open your web browser, http://localhost/pma/ and login with root, and the password you provided during MySQL installation. There is your fresh MySQL + phpMyAdmin, just like what I have on my Debian box.

MSSQL
MSSQL is just a generic name for SQL server products from Microsoft. On my windows machine, I’m currently using SQL server 2000. Yes, outdated shit, but it is FREE FOR 4 MONTHS(120 days), get it in Microsoft Download Center. Mind you, just like other Microsoft products, there’s a series of service packs available for this SQL Server 2000, I’ve already patched it to SP4, I want it last for the full 120 days without causing any problem, hehe.

The installation for this should be absolutely easy, choose standard installation, SQL authentication mode, and include client tools. Client tools are essential because from time to time, you will find the Enterprise Manager and Query Analyzer useful for certain tasks. Enterprise Manager is the client tool I use for SQL Server, just like phpMyAmin for MySQL.

When everything is installed and setup nicely, go to your Start Menu -> Programs -> Microsoft SQL Server -> Enterprise Manager. Connect to your local server, you should see the good ol’ NorthWind database inside. By default, there will be a tray icon running, indicates that your MSSQLServer is running.

Well, this post covered the setups for both MySQL and MSSQL on my Windows XP Pro O/S, I will go into how to connect to the databases in both PHP and ASP.NET server script in the coming updates.

Series
PHP VS ASP.NET - The Beginning.
PHP VS ASP.NET - Connecting to Database

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • Reddit
  • YahooMyWeb
Ratings:
 Votes | Average: 0 out of 5 Votes | Average: 0 out of 5 Votes | Average: 0 out of 5 Votes | Average: 0 out of 5 Votes | Average: 0 out of 5 (No Ratings Yet)
Loading ... Loading ...

Text Link Ads


Related Post(s)

2 Responses to “PHP VS ASP.NET - The Databases.”

  1. Chris Love Says:

    Why don’tg you get the FREE version of SQL Server? Unless you are developing a highly available application that will need to scale, just use the free version. 99.9% of web sites can use it because they really get no traffic or store that much data anyway.
    http://msdn.microsoft.com/vstudio/express/sql/register/default.aspx

  2. Yien Bin Says:

    Thanks Chris for the info, I’m totally a newbie in this windows environment. I will test out the express version once I get the time.

Leave a Reply