To use agdb, you must first install the iODBC driver manager before configuring and installing AGLIB. See Components of AGLIB and required third-party packages for more information on agdb and see Installation for installation information. You also need to install a database server (such as MySQL) and its ODBC driver (such as MyODBC).
The system was tested under the following configuration:
MySQL-3.23.33 or above
MyODBC-2.50.36 or above
libiodbc-2.50.3 or above
(Note: if you are installing iODBC RPMs, you need both iODBC Driver Manager Runtime Package and iODBC RPM Developers Kit)
Recommended installation procedure:
ODBC uses connection strings to connect to database servers. A connection string contains information such as hostname, database name, user name, password etc.
The following table shows some of the parameters used in a connect string, for a complete list, see http://www.mysql.com/doc/M/y/MyODBC_connect_parameters.html.
ODBC connect string arguments | What the argument specifies |
---|---|
DSN | Registered ODBC Data Source Name. |
SERVER | The hostname of the database server. |
UID | User name as established on the server. In SQL Server this is the logon name. |
PWD | Password that corresponds with the logon name. |
DATABASE | Database to connect to. If not given, DSN is used. |
DSN is the registered ODBC Data Source Name, it should be defined in your ~/.odbc.ini file. All other arguments can be either defined in .odbc.ini file, or defined in the connect string itself.
To gain access to most ODBC data sources, you must provide a valid User ID and corresponding password. These values are initially registered by the database administrator.
Probably the easiest way is to define every argument in file .odbc.ini under your home directory. The following is a sample entry for DSN 'talkbank' in the configuration file for iODBC. To simplify the explanation line numbers have been included. Please note that UID and PWD become USER and PASSWORD, respectively, in iODBC's configuration file.
1 [talkbank] 2 Driver = /pkg/ldc/lib/libmyodbc.so 3 DSN = talkbank 4 SERVER = talkbank.ldc.upenn.edu 5 USER = myuserid 6 PASSWORD = mypasswd 7 DATABASE = talkbank
Line 1 is the name of the driver section, which is 'talkbank'. You can have multiple driver sections in one configuration file. Line 2 specifies the odbc driver to use. Line 3 gives the name of the DSN, which is 'talkbank'. Line 4 specifies the hostname of the machine on which the database server is running. Line 5 is the user name to use to connect to the server. Line 6 is the password associated with the user name. Line 7 is the database to connect to.
If you have all required arguments specified in your .odbc.ini file like the one above, the connect string can simply be:
DSN=talkbank;
If you have not specified some of the arguments, say USER and PASSWORD, in the configuration file, you can still specify them in your connect string:
DSN=talkbank;UID=myuserid;PWD=mypasswd;