Installing and Configuring Apache 2 on a Windows XP Machine - Configuring MySql
(Page 5 of 5 )
All that remains is to install and configure MySql. This is probably the trickiest part and involves several steps for success. First, download the MySql 4.1 installer for Windows from www.mysql.com and run it. Accept all the defaults and use localhost for the server name. A guest account will work, but will not be as secure as one with a password.
Once MySql is installed, go to the System control panel applet, select the Advanced tab and click the Environment Variables button. Highlight the Path variable and select the Edit button. Go the very end of the line and add ;C:\php then click OK.

You’ll need to restart the machine at this point. Now go to the find files option in the start menu and do a search for libmysql.dll, then copy this file to your default PHP location (C:\php). Now go back to the find files window, do a search for php.ini and open the file found in Notepad. Scroll down until you find ;extension=php_mysql.dll and remove the semi-colon from the beginning of the line. Save this file and restart Apache. This should work fine, but if you get an error message saying that the libmysql.dll file could not be found, try copying this file to the Apache Bin folder as well.
To test MySql, open Notepad and type the following:
<?php
$dbServer='localhost';
$dbUser='root';
$dbPass=' ';
$dbName='test';
$link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die
("Could not connect");
print "Connected successfully<br>";
mysql_select_db("$dbName") or die("Could not select database");
print "Database selected successfully<br>";
mysql_close($link);
?>
This will simply attempt to connect to the server and select the test database that is created during the MySql installation. Save this file as mysql.php in your web site folder then open a browser and type http://localhost/mysql.php. You should see a web page displaying:
Connected successfully
Database selected successfully
Your WAMP installation is now complete. You should now be all set to begin creating and testing complex database driven, dynamic web sites. Please note that the set up described in this article is for closed, development environments only. This configuration is in no way secure and should not be used for production.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|