ASP NUKE MySQL SETUP INSTRUCTIONS ================================= 09/16/2004 These instructions explain how to setup ASP Nuke with a MySQL database server under Microsoft Windows. This will not allow you to run ASP Nuke in a Unix environment. Even if you don't have MySQL server installed, it is a simple matter to install it on your web server and access it through ASP. ASP Nuke also includes a setup wizard which will perform a lot of these setup steps for you. If you want to utilize the setup wizard, you will still have to complete the following steps before running the wizard: * Installing MySQL * Creating the ASP Nuke database * Installing MyODBC * Configuring MyODBC * Configure the IIS web site * Unpack the ASP Nuke distribution in the web site folder * Edit the global.asa file with the database connection string After completing these steps, you are ready to run the setup wizard for your nuke application. Simply point your browser to the following location: http://www.yourdomain.com/setup/setup1.asp Replace the "yourdomain" with the domain name you are using to host the site. If you are hosting the site locally, you can use "http://localhost/...". The instructions on the screen will guide you on setting up your nuke application. If you would prefer to do the installation manually, please follow all of the directions shown below. Installing MySQL ---------------- If you don't have a database already and you need to install one you are in luck! MySQL is a free database server originally written for the Unix O/S which was ported to work on Windows servers as well. It is very easy to use and can be installed quickly and easily using the install package. We recommend that you install the database server on the same machine as your webserver. MySQL is a very powerful and efficient database server and won't take up much resources on your machine. You also have the option of putting the database server on a different box (but I won't be supporting this yet until I have time to test it out myself.) To get the installer package for MySQL, you can go to the following URL: http://dev.mysql.com/downloads/mysql/4.0.html You will want to download the "Windows" version WITH the installer. Just run the installer program and follow the instructions on the screen. Pretty easy so far. Creating the ASP Nuke Database ------------------------------ You might already have a database setup for ASP Nuke. If so, that is great news because you can skip all of the steps in this section and proceed to "Setting up the Initial Data". To create the ASP Nuke database, you should use the "mysqladmin" command-line tool that is included with the MySQL database server. You will need to open a command prompt and change directory to the folder where these are located. Typically this is in a folder called "bin" where you installed MySQL database server. You can optionally modify your environment variables to include the MySQL "bin" directory in your path (for advanced users only) You then need to run the following command to create the new MySQL database: mysqladmin -u root create aspnuke This will work for the default "root" user which doesn't have a password. If you were assigned a username and password for your MySQL database, you can try creating a new database using the following command. mysqladmin -u username -p password create aspnuke If you are doing this remotely, you will have to use a program such as telnet which gives you access to the server via a shell account. If you don't have this type of access, you will have to ask your hosting provider to setup your MySQL database for you. Setting up the Database Schema ------------------------------ First we need to setup the database schema that will define the database tables used to hold all of the information that ASP Nuke needs to run. The script to do this is found in the following directory: /setup/schema_mysql.sql Open up a command-prompt on your database server and navigate to the MySQL "bin" folder. You will probably also want to copy the "schema_mysql.sql" file to this folder. You can send this database script to your ASP Nuke database with the command shown below: mysql -u root aspnuke < schema_mysql.sql This will create the entire database schema for ASP Nuke. Setting up the Initial Data --------------------------- Just like when we setup the database schema, we will need to open a command prompt on the database server and navigate to the MySQL "bin" folder. Then we will need to copy the mysql data script to the MySQL "bin" folder. This is found in the ASP Nuke directory at: /setup/data_mysql.sql On the command prompt type: mysql -u root aspnuke < data_mysql.sql This should insert all of the data rows that are initially needed to access ASP Nuke. Installing MyODBC ----------------- In order for the ASP Nuke application to be able to communicate with your MySQL database, you will need to install the ODBC drivers for MySQL. These are made available from the MySQL developer team at the following URL: http://dev.mysql.com/downloads/connector/odbc/3.51.html The MyODBC drivers need to be installed on the web server machine and NOT the database server machine. This is because the ASP scripts use the MyODBC driver to communicate with the database. If you don't have access to the web server which will be hosting your site, then you will have to ask your host provider to set this up. If all of this is too much trouble, just contact Orvado Technologies and we can setup an ASP Nuke / Hosting Plan for you. Orvado Technologies - http://www.orvado.com Configuring MyODBC ------------------ After MyODBC has finished installing and you have created a new database for the nuke application, you can configure the MyODBC datasource name. This is done the same way that you would configure any data source: by using the ODBC control panel. The ODBC configuration needs to be made on the web server which is hosting your ASP Nuke application. This is because the web site Open your control panel and click on the Administrative Tools folder Double-click the "Data Sources (ODBC)" icon Click on the "System DSN" tab Click the "Add.." button Select the "MySQL ODBC 3.51 Driver" and click "Finish" Enter the "Data Source Name" (any name will work - you can use the name of your database here) Set the Host/Server Name where the MySQL server resides (the default will work if your database and web server) Enter the database name you created earlier for the ASP Nuke application Enter the username and password used to access the database Be sure to click the "Test Data Source" button to make sure all is OK If you are new to MySQL and are starting with a fresh install, the default behavior is to setup new databases with a username of "root" and an empty password. So if you are unsure of the username and password, you might want to give this a try. Defining the ASP Nuke Connection String --------------------------------------- In order for ASP Nuke to know how to connect to your database, you will need to define the ASP Nuke connection string. This is found in the special file "global.asa" which as at the root folder where your ASP Nuke is installed. Edit this file and find the place where "asaConnectionString" is defined. This string should be changed to a valid MySQL ODBC connection string like: "odbc;DRIVER={MySQL ODBC 3.51 Driver};DSN=aspnuke; OPTION=3" Save this file on the server and you are ready to test out ASP Nuke. Completing Configuration ------------------------ From here on, you should use the setup wizard to complete the configuration. This will allow you to setup the application variables which define how your ASP Nuke installation was setup. Do this by navigating to the following location: http://www.yourdomain.com/setup/setup3.asp Just fill out the forms for each tab to define the properties for your ASP Nuke application. After you are done, you can click the links at the bottom of the screen to view your new application. Enjoy! Direct any comments, questions or suggestions to: support@aspnuke.com MySQL Administration -------------------- In order to administer your ASP Nuke application, you will need to login to the administrators area at: http://www.yourdomain.com/module/admin/ If you ran the MySQL Data Setup ("Setting up the Initial Data"), your nuke application will be configured with a default administrator account. Use this to login to the administrator's area username: nukeadmin password: changeme After you login, it's always a good idea to update your username and password. This is found in the "Users" administration area.