Changeset 2817

Show
Ignore:
Timestamp:
03/29/06 00:03:44 (18 years ago)
Author:
jerome
Message:

Improved documentation for PostgreSQL and MySQL backends setup.

Location:
pykota/trunk/initscripts
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/initscripts/mysql/pykota-mysql.sql

    r2695 r2817  
    3535-- 
    3636-- Create the print quota database users 
    37 -- NOTE: Change the "IDENTIFIED BY" string to the password you would like. 
     37-- NOTE: Change the "IDENTIFIED BY" strings to the passwords you would like. 
    3838--  
    3939GRANT USAGE ON *.* TO 'pykotauser'@'localhost' IDENTIFIED BY 'readonlypw'; 
     
    5454                   lifetimepaid FLOAT DEFAULT 0.0, 
    5555                   limitby VARCHAR(30) DEFAULT 'quota', 
    56                    description TEXT, 
    57                    overcharge FLOAT NOT NULL DEFAULT 1.0) TYPE=INNODB; 
     56                   description TEXT, 
     57                   overcharge FLOAT NOT NULL DEFAULT 1.0) TYPE=INNODB; 
    5858                    
    5959-- 
     
    6262CREATE TABLE groups (id INT4 PRIMARY KEY NOT NULL AUTO_INCREMENT, 
    6363                    groupname VARCHAR(255) UNIQUE NOT NULL, 
    64                     description TEXT, 
     64                    description TEXT, 
    6565                    limitby VARCHAR(30) DEFAULT 'quota') TYPE=INNODB; 
    6666                     
     
    7373                      priceperpage FLOAT DEFAULT 0.0, 
    7474                      priceperjob FLOAT DEFAULT 0.0, 
    75                       passthrough ENUM('t','f') DEFAULT 'f', 
    76                       maxjobsize INT4) TYPE=INNODB; 
     75                      passthrough ENUM('t','f') DEFAULT 'f', 
     76                      maxjobsize INT4) TYPE=INNODB; 
    7777                     
    7878-- 
     
    8787                        hardlimit INT4, 
    8888                        datelimit TIMESTAMP, 
    89                         maxjobsize INT4, 
     89                        maxjobsize INT4, 
    9090                        warncount INT4 DEFAULT 0,  
    91                         FOREIGN KEY (userid) REFERENCES users(id), 
    92                         FOREIGN KEY (printerid) REFERENCES printers(id))  
    93                         TYPE=INNODB; 
     91                        FOREIGN KEY (userid) REFERENCES users(id), 
     92                        FOREIGN KEY (printerid) REFERENCES printers(id))  
     93                        TYPE=INNODB; 
    9494CREATE INDEX userpquota_u_id_ix ON userpquota (userid); 
    9595CREATE INDEX userpquota_p_id_ix ON userpquota (printerid); 
     
    113113                        options TEXT, 
    114114                        hostname VARCHAR(255), 
    115                         md5sum TEXT, 
    116                         pages TEXT, 
    117                         billingcode TEXT, 
    118                         precomputedjobsize INT4, 
    119                         precomputedjobprice FLOAT, 
     115                        md5sum TEXT, 
     116                        pages TEXT, 
     117                        billingcode TEXT, 
     118                        precomputedjobsize INT4, 
     119                        precomputedjobprice FLOAT, 
    120120                        jobdate TIMESTAMP DEFAULT now(), 
    121121                        CONSTRAINT checkUserPQuota FOREIGN KEY (userid, printerid) REFERENCES userpquota (userid, printerid) 
    122                         ) TYPE=INNODB; 
     122                        ) TYPE=INNODB; 
    123123CREATE INDEX jobhistory_u_id_ix ON jobhistory (userid); 
    124124CREATE INDEX jobhistory_p_id_ix ON jobhistory (printerid); 
     
    134134                         softlimit INT4, 
    135135                         hardlimit INT4, 
    136                         maxjobsize INT4, 
     136                        maxjobsize INT4, 
    137137                         datelimit TIMESTAMP, 
    138                         FOREIGN KEY (groupid) REFERENCES groups(id), 
    139                         FOREIGN KEY (printerid) REFERENCES printers(id)) 
    140                         TYPE=INNODB; 
     138                        FOREIGN KEY (groupid) REFERENCES groups(id), 
     139                        FOREIGN KEY (printerid) REFERENCES printers(id)) 
     140                        TYPE=INNODB; 
    141141CREATE INDEX grouppquota_g_id_ix ON grouppquota (groupid); 
    142142CREATE INDEX grouppquota_p_id_ix ON grouppquota (printerid); 
     
    148148CREATE TABLE groupsmembers(groupid INT4, 
    149149                           userid INT4, 
    150                            FOREIGN KEY (groupid) REFERENCES groups(id), 
    151                            FOREIGN KEY (userid) REFERENCES users(id), 
     150                           FOREIGN KEY (groupid) REFERENCES groups(id), 
     151                           FOREIGN KEY (userid) REFERENCES users(id), 
    152152                           PRIMARY KEY (groupid, userid)) TYPE=INNODB; 
    153153                            
     
    157157CREATE TABLE printergroupsmembers(groupid INT4, 
    158158                           printerid INT4, 
    159                            FOREIGN KEY (groupid) REFERENCES groups(id), 
    160                            FOREIGN KEY (printerid) REFERENCES printers(id), 
     159                           FOREIGN KEY (groupid) REFERENCES groups(id), 
     160                           FOREIGN KEY (printerid) REFERENCES printers(id), 
    161161                           PRIMARY KEY (groupid, printerid)) TYPE=INNODB; 
    162162-- 
     
    166166                       userid INT4, 
    167167                       amount FLOAT, 
    168                        description TEXT, 
     168                       description TEXT, 
    169169                       date TIMESTAMP DEFAULT now(), 
    170                        FOREIGN KEY (userid) REFERENCES users(id)) TYPE=INNODB; 
     170                       FOREIGN KEY (userid) REFERENCES users(id)) TYPE=INNODB; 
    171171CREATE INDEX payments_date_ix ON payments (date); 
    172172 
     
    175175-- 
    176176CREATE TABLE coefficients (id INT4 PRIMARY KEY NOT NULL AUTO_INCREMENT, 
    177                            printerid INT4 NOT NULL, 
    178                            label VARCHAR(255) NOT NULL, 
    179                            coefficient FLOAT DEFAULT 1.0, 
    180                            FOREIGN KEY (printerid) REFERENCES printers(id), 
    181                            CONSTRAINT coeffconstraint UNIQUE (printerid, label) 
    182                            ) TYPE=INNODB; 
     177                           printerid INT4 NOT NULL, 
     178                           label VARCHAR(255) NOT NULL, 
     179                           coefficient FLOAT DEFAULT 1.0, 
     180                           FOREIGN KEY (printerid) REFERENCES printers(id), 
     181                           CONSTRAINT coeffconstraint UNIQUE (printerid, label) 
     182                           ) TYPE=INNODB; 
    183183 
    184184--  
  • pykota/trunk/initscripts/mysql/README.mysql

    r2816 r2817  
    5757            NB : replace 'readwritepw' with the password you chose 
    5858            for user 'pykotaadmin' when you modified pykota-mysql.sql 
     59             
     60        - IMPORTANT : if your database is not located on the print server,  
     61          replace 'localhost' in the lines above with your database server's  
     62          hostname or IP address. If your database server doesn't listen on 
     63          its standard port, add the port number at the end of the hostname 
     64          with a colon to separate the hostname from the port. 
     65          See pykota/conf/pykota.conf.sample for examples. 
    5966         
    6067============================================================ 
  • pykota/trunk/initscripts/postgresql/pykota-postgresql.sql

    r2622 r2817  
    3535-- 
    3636-- Create the print quota database users 
     37-- NOTE: Change the password values to the passwords you would like. 
    3738--  
    38 CREATE USER pykotaadmin; 
    39 CREATE USER pykotauser; 
     39CREATE USER pykotauser WITH UNENCRYPTED PASSWORD 'readonlypw' NOCREATEDB NOCREATEUSER; 
     40CREATE USER pykotaadmin WITH UNENCRYPTED PASSWORD 'readwritepw' NOCREATEDB NOCREATEUSER; 
    4041 
    4142--  
  • pykota/trunk/initscripts/postgresql/README.postgresql

    r2622 r2817  
    3030and read the next one. 
    3131 
     32        - edit the pykota-postgresql.sql file and modify the passwords on 
     33          the 'CREATE USER' lines. 
     34           
    3235        - Launch the psql frontend and connect to the 
    3336          database template1 as a PostgreSQL administrator 
     
    3639          as user 'root' : 
    3740           
    38             $ su - postgres 
     41            # su - postgres 
    3942             
    4043          you're now user 'postgres', then continue with :    
    4144           
    42             $ psql -h localhost -U postgres template1 
     45            $ psql -h localhost -U postgres -f pykota-postgresql.sql template1 
    4346           
    44         - Executes the pykota-postgresql.sql script :   
     47        - If no error message appears, your PostgreSQL PyKota storage  
     48          is now ready for use. NB : a lot of NOTICE messages might appear, 
     49          this is perfectly normal. 
     50           
     51        - In ~pykota/pykota.conf, ensure that the following lines 
     52          are present and unique inside the [global] section : 
    4553         
    46             template1=# \i pykota-postgresql.sql 
     54            storagebackend : pgstorage 
     55            storageserver : localhost 
     56            storagename : pykota 
     57            storageuser : pykotauser 
     58            storageuserpw : readonlypw 
    4759             
    48         - Quit the psql frontend :     
     60            NB : replace 'readonlypw' with the password you chose 
     61            for user 'pykotauser' when you modified pykota-postgresql.sql 
     62             
     63        - In ~pykota/pykotadmin.conf ensure that the following lines 
     64          are present and unique inside the [global] section : 
    4965         
    50             template1=# \q 
     66            storageadmin : pykotaadmin 
     67            storageadminpw : readwritepw 
    5168             
    52         - Your PostgreSQL PyKota storage is now ready 
    53           for use. 
     69            NB : replace 'readwritepw' with the password you chose 
     70            for user 'pykotaadmin' when you modified pykota-postgresql.sql 
    5471         
     72        - IMPORTANT : if your database is not located on the print server,  
     73          replace 'localhost' in the lines above with your database server's  
     74          hostname or IP address. If your database server doesn't listen on 
     75          its standard port, add the port number at the end of the hostname 
     76          with a colon to separate the hostname from the port. 
     77          See pykota/conf/pykota.conf.sample for examples. 
     78           
    5579============================================================ 
    5680 
     
    7094  instead : 
    7195           
    72             $ su - postgres 
     96            # su - postgres 
    7397             
    7498  You're now user 'postgres', then continue the upgrade by following