|STAR Computing||Tutorials main page|
|Offline computing tutorial||Maintained by Jeff Porter|
|Last modified Fri Jul 03 00:19:00 1998|
Index of STAR-MySQL topics covered here
The following table gives the status of STAR Mysql Servers. It is currently a static table but will become automatic update from database with a list of databases to which each server has primary responcibility.
|www.star.bnl.gov||Original STAR server for development & Testing||3306||In Operation||Selected DBs backed up|
|db1.star.bnl.gov||STAR server accessible from RCAS. Primary server for input into offline production||3306||In Operation, data is transfered nightly from duvall||not backed up (see duvall server)|
|onlsun1.star.bnl.gov||Test Server OnlTest1 domain||3307||In Operation||not backed up|
|onlsun1.star.bnl.gov||Test Server OnlTest2 domain||3308||In Operation||not backed up|
|onlsun1.star.bnl.gov||Test Server OnlTest3 domain||3309||In Operation||not backed up|
|onlsun1.star.bnl.gov||Test Server OnlTest4 domain, Daq & Trg interface:||3310||In Operation||not backed up|
Mysql maintains access permissions on the basis of hosts, users, databases, and tables. For our case, we utilize the users and databases options. Specifically we specify read ("select") access to all star users from all machines. Then we can give specific users (or "group-accounts") write privilege to specific databases. We can do this via password protection, however, the Mysql C-API on which the STAR C++ API is built recognizes passwords only as an arguement to the connection c-function. This c-function is purposely hidden from the user codes. Now for other Mysql API's (e.g. perl & command line), the password will automatically be read from a ".rhosts" type file (.my.cnf) in the user's home directory. We will very likely have the C++ API independently parse this same file so that access with passwords have a common form. This is currently not implemented and passwords are not in place for processes that rely upon the C++ API for database access. Simply, one's user name is mapped to a privilege on a given database.|
Mysql provides a command line client interface which is accessed via
running "mysql" at the unix shell prompt. The mysql binary is installed
via afs and made avialable in /opt/star/bin. It can be run with a number of command line arguments for purpose of identifying which server to connect with.
There are several "scripting" interfaces available for Mysql. The most prominent in the perl interface. This interface is not Mysql-specific but has an Mysql driver implemented behind the interface. The interface is documented in some general Perl books (e.g. Perl Cookbook, Tom Christiansen & Nathan Torkington,O'Reilly, 1998) as well as in the Mysql Web documentation.
The database administration for STAR is being done in Perl. Currently there is no documentation yet on the general set of Perl scripts used for this purpose, but this will be added as time and need allow.|
A very simplified scripting access avialabe via the command line interface and unix pipes. For example, the example query of the previous section could be done via,