Manual Database Creation Steps

1. Create the WACS database account (MySQL)

Connect to the database as the root user, giving the password as appropriate; if you've not set one the default is blank so just press return when prompted. You then create the database and the user account (once for each place you might be coming from), give access to that user account to the database, flush the contents and then quit. Here's a sample conversation - you obviously need to replace the 'myserver.example.com' with whatever your real fully qualified domain name is. You might also wish to choose a more secure password, but do remember you need to change it in /etc/wacs.d/wacs.cfg (dbpass and phpdbconnect variables) as well or it just won't work.

Here goes:

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 80
Server version: 5.0.45 Source distribution

Type 'help;' or \h for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE wacs;
Query OK, 1 row affected (0.03 sec)

mysql> CREATE USER 'wacs'@'myserver.example.com'
    -> IDENTIFIED BY 'wacs';
Query OK, 0 rows affected (0.08 sec)

mysql> CREATE USER 'wacs'@'myserver'
    -> IDENTIFIED BY 'wacs';
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE USER 'wacs'@'localhost'
    -> IDENTIFIED BY 'wacs';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL ON wacs.* TO wacs;
Query OK, 0 rows affected (0.00 sec)

mysql> COMMIT;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> QUIT;
Bye
#

2. Create the necessary database schemas

The next step is to log in as the wacs user account you just created and run the SQL scripts that create the various database tables. There are scripts provided for both MySQL 5 and Oracle 10, but this example is based upon using the MySQL 5 version. These should be found in /usr/share/wacs/creation/MySQL5.

# cd /usr/share/wacs/creation/MySQL5
# mysql -u wacs -p wacs
Enter password:
Welcome to the MySQL monitor.  Commands end withh ; or \g.
Your MySQL connection id is 82
Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> source create_mysql.sql
WACS Database Table Creation Script for MySQL
Commencing Table Creation:
  1. Photographer
Query OK, 0 rows affected (0.23 sec)

  2. Vendor
Query OK, 0 rows affected (0.01 sec)

  3. Sets
Query OK, 0 rows affected (0.01 sec)

  4. Models
Query OK, 0 rows affected (0.02 sec)

  5. Assoc
Query OK, 0 rows affected (0.01 sec)

  6. Idmap
Query OK, 0 rows affected (0.01 sec)

  7. Download
Query OK, 0 rows affected (0.00 sec)

  8. Tag
Query OK, 0 rows affected (0.01 sec)

  9. Conn
Query OK, 0 rows affected (0.02 sec)

 10. Keyword
Query OK, 0 rows affected (0.01 sec)

 11. Wacsuser
Query OK, 0 rows affected (0.01 sec)

 12. Attrib
Query OK, 0 rows affected (0.02 sec)

 13. Notes
Query OK, 0 rows affected (0.01 sec)

Tables Created - Committing Changes
Query OK, 0 rows affected (0.00 sec)

Completed.
mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye
#

3. Create default database contents (optional)

[Note]Note

this step is RECOMMENDED unless you know precisely what you are doing. Some commercial sites may not wish to preload this data, but should substitute their own alternatives if they want certain features to work.

[Warning]Warning

If you changed the password in step 1. above from the default value, you NEED to have made the matching change to the configuration file before doing this step.

[Tip]Tip

The wacspop replaced the previous seperate commands in Wacs release 0.8.6. If you're using an earlier release these instructions will not work. Check the earlier version of this document instead!

There are four database tables that contain standard values, plus whatever you add to them over time; these are called keywords, photographers, attrib and vendors. In this step you will be loading some initial values into these database tables. To do this you need to go to /usr/share/wacs/samples/database and run the wacspop populate command in the utils directory on each of the XML data files there in turn. There is also the users.xml file which you should propably also load - you will need it if using the database as the authentication source. This is typically necessary for WebHosted sites and extremely useful on any pay sites.

# cd /usr/share/wacs/samples/database
# /usr/share/wacs/utils/wacspop keywords.xml
Inserting Entry For Keyword: seethru
Inserting Entry For Keyword: nopanties
Inserting Entry For Keyword: teen
[...]
Inserting Entry For Keyword: cyc
Inserting Entry For Keyword: country
Inserting Entry For Keyword: alley
# /usr/share/wacs/utils/wacspop photographers.xml
Inserting Entries For Photographer: DFR
Inserting Entries For Photographer: SWE
Inserting Entries For Photographer: MAX
[...]
Inserting Entries For Photographer: JAN
Inserting Entries For Photographer: TOB
Inserting Entries For Photographer: HBM
# /usr/share/wacs/utils/wacspop vendors.xml
Inserting Entries For Site: SE
Inserting Entries For Site: WACSD
Inserting Entries For Site: FJ
[...]
Inserting Entries For Site: AMK
Inserting Entries For Site: KPC
Inserting Entries For Site: KHA
# /usr/share/wacs/utils/wacspop attrib.xml
Inserting Entries For Attribute: shaven
Inserting Entries For Attribute: tinytit
Inserting Entries For Attribute: nopanties
[...]
# 

4. Import sample model records (optional)

[Note]Note

This is a very optional step but will help you if you're setting up a WACS web site for the first time.

This step loads three sample model records into the database to provide an example of how a typical model record might look. There are three such files provided in /usr/share/wacs/samples/models containing details of three models: Kaz B, Sabrina and Roxanne.

# cd /usr/share/wacs/samples/models
# wacsimport Sabrina-18.xml
Keyless ID map for JAFN
# wacsimport Roxanne-24.xml
# wacsimport KazB-30.xml

5. Import sample set records (optional)

[Note]Note

For some sample sets for your new WACS web site, we invite you to visit our demonstration site at PinkMetallic.com - [CAUTION - contains adult material]. Access to this site is currently free but there may be a small charge at some point in the future if referal revenues don't cover costs.

You will first need to download the sets that appeal to you, so if you select set number 14 for instance, you will need the set14.zip file and the set14.xml file. These can be found via the link titled WACS Resources from the main menu on PinkMetallic.com. Once you have these downloaded, place them both in the same directory and run the wacsxmlin program to load the data from the XML file. The wacsxmlin program requires the name of the .xml file it is to read as an argument, eg wacsxmlin set4.xml. The zip file will be automatically unpacked and it's contents placed in the images area. In this example, we're going to use the default layout, which if you haven't edited the configuration file will be gallery style (please see the discussion on Site Layout in the administration guide for more details).

# cd ~/Download
# wacsxmlin --default set14.xml
Unpacking archive:
  Roxanne07001.jpg
  Roxanne07002.jpg
  Roxanne07003.jpg
[...]
#