MySQL is the world's most popular open source database software, with over 100 million copies of its software downloaded or distributed throughout its history. With its superior speed, reliability, and ease of use, MySQL has become the preferred choice for Web, Web 2.0, SaaS, ISV, Telecom companies and forward-thinking corporate IT Managers because it eliminates the major problems associated with downtime, maintenance and administration for modern, online applications.
MySQL is a key part of LAMP (Linux, Apache, MySQL, PHP / Perl / Python), the fast-growing open source enterprise software stack. More and more companies are using LAMP as an alternative to expensive proprietary software stacks because of its lower cost and freedom from platform lock-in.
The MySQL database is owned, developed and supported by Sun Microsystems, one of the world's largest contributors to open source software. MySQL was originally founded and developed in Sweden by two Swedes and a Finn: David Axmark, Allan Larsson and Michael "Monty" Widenius, who had worked together since the 1980's. More historical information on MySQL is available on Wikipedia.http://www.mysql.com/about/
Download and install MySQL from http://dev.mysql.com/downloads/. Just make sure you get the free MySQL Community Server release.
Run the executable file and use the following settings:
C:\phpin the system PATH (this process is explained in a FAQ entry).
php.inifile in a text editor and search for
;extension=php_mysql.dlland remove the
;character in front of the line.
php_mysql.dlleither your extension folder (i.e.
C:\php\ext) isn't correctly configured or windows can't find the
test.php file in your
DocumentRoot folder and put the code
hereinafter into it.
<?php // hostname or ip of the server (for local testing localhost should work) $dbServer = "localhost"; // username and password to log onto db server (what you entered in MySQL installation) $dbUser = "root"; $dbPass = ""; // name of database (MySQL by default comes with an empty database named "test") $dbName = "test"; // open server connection $link = mysql_connect($dbServer, $dbUser, $dbPass) or die("Could not connect to server"); echo "<p>Connected successfully</p>"; // test database connection mysql_select_db($dbName) or die("Could not select database"); echo "<p>Database selected successfully</p>"; // close server connection mysql_close($link); ?>
Open your browser and head to http://localhost/test.php, you should get two success messages.