FunctionPackage: dbi.mysqlToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version


Arguments: &key host port user file password database external-format client-flags

The arguments are:

Connects to the mysql database, authenticates the user and optionally sets the current database.

The instance of mysql to which to connect is specified by either the file argument or the host and port arguments. If both the client and server are running the same Unix machine then the file argument can be used to specify the Unix-domain socket on which mysql is listening for a connection. Typically that socket is named "/var/lib/mysql/mysql.sock".

If a file argument isn't given to connect then the host and port arguments specify the location of the mysql server. By default the host argument has value "localhost" (meaning the same machine as the client) and the port argument has the value 3306 (which is the normal port on which mysql listens).

Once connected to the mysql server the connect function will then pass the user and password to the mysql server so that it can authenticate the client. The rules for authentication are described in great detail in the MySQL reference manual (available on the website, whose main page refers to it as the MySQL Manual). The default value for the user argument is the user's login name (the value returned by user-name). The password for an account is given in the mysql.user table of the mysql database. This password is unrelated to the password used to log onto the machine. If the database argument is given then once authentication succeeds, the connect makes the given database the current database.

connect returns a mysql object which can be used as the value of the db argument in calls to other functions in this library. connect also sets the value of the symbol *mysql* to the mysql object being returned. Since *mysql* is the default value for the db argument in other functions in this library, this means that if you're just experimenting with mysql interactively, you can call connect and then other functions in this library without saving the mysql object returned by connect and then passing it back in subsequent calls.

See mysql.htm for information on the Allegro MySQL facility.

Copyright (c) 1998-2017, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2017.2.15.

Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version