Trivial database HOWTO MySQL is just one of a number of excellent database implementations. MySQL is popular because it's free. http://www.mysql.com/ Database setup: Set up password "funker": mysqladmin -u root password funker (You get 'Access denied for user:' if you enter the wrong password.) Create a database "testdb": mysqladmin -u root -pfunker create testdb In /var/lib/mysql, /testdb is created. ls -al /var/lib/mysql/testdb/ ------------ Interactive SQL Queries ------------ Now you can interactively edit the database with mysql -u root -pfunker -Dtestdb Now you type SQL commands. CREATE builds a new table. CREATE TABLE log ( num INT NOT NULL auto_increment, importance INT DEFAULT '0' NOT NULL, date TIMESTAMP NOT NULL, user VARCHAR(10) DEFAULT '', item VARCHAR(40), PRIMARY KEY (num), KEY xdate(date), KEY ximportance(importance) ); SHOW TABLES; DESCRIBE log; Using the database: Once the tables are set up (a one-time step for most projects), you can then add new records with INSERT: INSERT INTO log (importance,user,item) VALUES (1,"olawlor",'Created table; start of debugging'); INSERT INTO log (importance,user,item) VALUES (0,"olawlor",'Checking out tables...'); INSERT INTO log (importance,user,item) VALUES (0,"nobody",'Silly crap'); INSERT INTO log (importance,user,item) VALUES (1,"nobody",'Not so silly no more!'); Note that spaces (e.g., between the table name and list of columns) are important. You "query" or display the data in the table with SELECT: SELECT * FROM log; SELECT * FROM log WHERE importance=1; SELECT * FROM log WHERE importance>0 AND user="nobody"; You can also modify the table definition--even for a table that already has data in it. ALTER TABLE log ADD ( files VARCHAR(10) default '' ); -------------------- C to Database Interface -------------- http://dev.mysql.com/doc/refman/5.0/en/apis.html Create a MYSQL object. Issue SQL queries. Read results. See subdirectories of this example program. ------------------- Perl Interface: DBI ----------------- http://search.cpan.org/~timb/DBI/DBI.pm See "perldoc DBI". ------------------- Java Interface: JBDC ----------------- http://java.sun.com/products/jdbc/ --- Embedding Database Server in Your Program --- http://dev.mysql.com/doc/refman/5.0/en/libmysqld-example.html