This tutorial will walk you through the following:
PHP and MySQL in Dreamweaver MX
MySQL is an extremely popular Open Source database management system that is licensed under the Gnu General Public License. It is available for almost all of the popular OS platforms and most Internet Service Providers will have MySQL installed and available for you to use as part of your hosting contract. For those of you who are writing applications that will violate the GPL. MySQL also offers a commercial license, which is very reasonably priced. We're not going to get into the details of what does and does not constitute a violation of the license - the MySQL web site has the full details (http://www.mysql.com/products/licensing.html) and examples of what you can and can't do with it. What we will be doing in this article and the next is getting an overview of how you can get going with PHP and MySQL in Dreamweaver MX. This article will concentrate on getting it all up and running.
Getting and setting up MySQL
The first thing that you will need to do is get and install MySQL. We're going to assume that you've managed to get PHP installed and configured for your web server, be it IIS, Apache or any of the many others.
As we said earlier, MySQL is Open Source, so if you are that way inclined, you can grab the MySQL source code and compile it yourself. For those of you who just want to get it up and running with minimal fuss, the MySQL web site provides binary installation versions of MySQL for you to download and install.
MySQL is currently available as two different versions. Version 3.23 has been
tested extensively in production environments and is the version you should
use if you intend to deploy your application in a production environment.
Version 4.0 is currently in gamma - it's beyond the beta stage, and has been used for over 2 months without any serious bugs. You should choose this version if you are doing new development. I use version 4.0 for all of my internal development and testing and it has been perfectly stable. The additional features in version 4 include speed enhancements, a new storage engine that supports transactions and low-level locking, and several other enhancements. At the time of writing Version 4.1 was announced as available, but there are currently no binary versions - source code only.
When you come to download MySQL you will notice that you can choose between Standard and Max. The Max version includes features that have not been thoroughly tested as well as debug information and should be used only if you wish to make use of these features. Since we won't be using any of the additional features introduced by version 4.0, you can download and install whichever version you prefer - http://www.mysql.com/downloads/index.html
Most hosting companies will already have MySQL set up for you, so we'll look at setting up MySQL for developing on your local machine. The Windows installation comes in the form of a Windows setup program - simply unzip the archive and run the SETUP.EXE file and install MySQL to its default location of C:\mysql.
To start MySQL, open a Command Prompt and change to the C:\mysql\bin folder. Type the command
This should display the message mysqld: ready for connections. You can now either leave this window minimized, and move onto setting up phpMyAdmin, or if you are running Windows NT, 200 or XP, install MySQL as a service. To do this stop the current console version of MySQL in the Command Prompt by typing Ctrl-C. When you are back at the prompt, type
MySQL will now appear in your Services control panel and you can start and stop it from there.
Allan comes from Cape Town, South Africa. He has been implicated in writing for several WROX, glasshaus, Wiley and Apress publications, generally in the 'cool stuff that PHP can do' sections.
You can catch up with him at his website http://www.mediafrenzy.co.za.