Included here are instructions for adding AUC user accounts in bulk. You must have access to a machine that can log in to the MySQL database directly (such as a UNIX machine with the 'mysql' command-line utility).
First, you must start out with a text file that contains the raw data about the users. The fields (seperated by tabs) should appear in the following order, with a newline seperating each user's entry:
Username | First Name | Last Name | Middle Name (optional) | Student ID (optional) | Role ("student", "staff", "system", "visitor", "parent", "guest", or a custom string) | Graduation Year (only necessary if Role is "student") | Permission Level ("normal", "sysop", or "guest") |
In addition, for users who you wish to be authenticated directly by AUC rather than using PAM, it is necessary to create another file containing initial passwords for these users. This file should also be tab-delimited, with newlines seperating each user's entry, and should have the following fields:
Username | Initial Password |
Now we will add the users to AUC. These instructions assume you are using a UNIX machine with the 'mysql' utility available. Type the command:
mysql -h hostname -u root -p
use database;
where database is the name
of the database containing information for your installation of AUC (the DB is called "auc" by
default). Next, issue the following command to import the user information:
LOAD DATA LOCAL INFILE "path" INTO TABLE userinfo LINES TERMINATED BY '\n' (uname, fname, lname, mname, id, grp, class, permissions);
where path is the location of the text file containing the user information. If the text file was
created in windows, the "LINES TERMINATED" portion of the command should read "LINES TERMINATED
BY '\r\n'". Type
"exit
" when finished.
If you need to import initial passwords from the second text file, run the following command from the shell:
cat path | auc_password_import | mysql -h hostname -u root -p database
where path is the location of the second text file (containing the initial passwords) and hostname and database are as specified previously. Enter the MySQL root password when prompted.