Setting Up Your Local Database
Here we will discuss installing and setting up your local database. We will be using MySQL. Previous versions of Cartweaver ColdFusion supported Microsoft Access, but in today's web environment, for an eCommerce based site Access is simply not a secure, reliable or viable enough database option. All support for Access has been discontinued.
Downloading installing MySQL
MySQL is available in a free open source, community edition and can be downloaded and installed in a number of ways. The method we recommend using one of the "all in one" install utilities that is available as a free download called XAMPP.
If you are using Cartweaver 4 ColdFusion, you may ask, I'm developing in ColdFusion, why should I install PHP, and wont this interfere with my ColdFusion environment? If your system is capable of running ColdFusion and most any of the recent Adobe applications, it should have no problem running the XAMPP applications at the same time. The advantage of doing it this way is the set up is quick, easy, and nearly a one-click operation, and it includes phpMyAdmin which is a reasonably good MySQL administrator, in short it's everything you need and set up is a breeze. The installation and setup for XAMPP is quite straight forward. Refer to the XAMPP documentation for details. So if you are using Cartweaver 4 PHP, install XAMPP and you are ready, if you are using Cartweaver 4 ColdFusion, after installing XAMPP you take about another ten minutes and to install the free ColdFusion developers edition and you are ready to go as well.
A note about MySQL administration tools. There are many MySQL admin apps, some by MySQL - such as MySQL WorkBench - and others that are open source. For general local development and testing the MySQL admin, installed with XAMPP is more than adequate.
For a standalone administration application that works both with local databases and can connect and administer remote databases We highly recommend Navicat for MySQL - While Navicat is available in a free "Lite" version, we strongly encourage you to go for the commercial version, it is available for around $99 and well worth the investment. The ability to drag-n-drop your MySQL databases between server alone is worth the cost of the application. The installation and setup for Navicat is quite straight forward. Refer to the Navicat documentation for details.
Creating Your Database
Once you have XAMPP installed you will need to create the database that your Cartweaver site will use.
- To do this in PHP MyAdmin you'll need to be sure XAMPP is running and then go to the XAMPP Control Panel
- Next in the XAMPP Control Panel make sure Apache and MySQL are running
- Then click in the Admin Button on the MySQL line, this will open PHP MyAdmin
- Make sure you are on the home page by clicking on the little house icon in the right hand column.
- On the home page you will see a section called MySQL Localhost and a field to Create New Database Enter the name of your database here, just leave all the other selections in their default settings, and click Create
- You will now be taken to your new database and see a message stating your database has been created.
- Stay on this page, you'll need to be there for the next step...
Creating User and Permissions
Once your database is created you'll need to set up a user and permissions for the database so ColdFusion can connect to the database as a data source. With PHPMyAdmin still open to the new database you created you will do the following;
- Find and click on the Privileges Tab
- Now locate and click on the Add New User icon and link
- Now, on the Create New User page, leave the settings fields in their default setting and enter a user name, host, and password.
- Here's a tip that will make things much easier going forward. The user name and password you enter here should be exactly the same as the user name and password your database on your host server will be using. The reason for this is, if these are the same, then the settings in your Cartweaver site will be the same in both places so your setting will work in both places to you won't have to worry about transferring your settings files back and forth.
- The host in this case will be localhost
- Don't use the Generate feature here
- Under Database for User - select "Grant all privileges on database"
- Under Global Privileges leave this unchecked - you only want to grant this user access to this one database.
- Then in the bottom right hand corner find and click the Go button
You are now ready to Create your data source connection and set up your Cartweaver database.