MySQL

Libraries

The MySQL back-end requires the MySQL C client library (libmysqlclient.so). The location of this library is specified via *mysql-so-load-path*, which defaults to /usr/lib/libmysqlclient.so. Additional flags to ld needed for linking are specified via *mysql-so-libraries*, which defaults to ("-lc").

Initialization

Use

(asdf:operate 'asdf:load-op 'clsql-mysql)
	

to load the MySQL back-end. The database type for the MySQL back-end is :mysql.

Connection Specification

Syntax of connection-spec

(host db user password &optional port)

Description of connection-spec

host

String representing the hostname or IP address the MySQL server resides on, or nil to indicate the localhost.

db

String representing the name of the database on the server to connect to.

user

String representing the user name to use for authentication, or nil to use the current Unix user ID.

password

String representing the unencrypted password to use for authentication, or nil if the authentication record has an empty password field.

port

String representing the port to use for communication with the MySQL server.

Notes

FDDL

  • drop-index requires a table to be specified with the :on keyword parameter.

  • views are not supported by MySQL.

  • The :transactions keyword argument to create-table controls whether or not the created table is an InnoDB table which supports transactions.

  • The :owner keyword argument to the FDDL functions for listing and testing for database objects is ignored.

FDML

  • Prior to version 4.1, MySQL does not support nested subqueries in calls to select.

Symbolic SQL Syntax

  • MySQL does not support the || concatenation operator. Use concat instead.

  • MySQL does not support the substr operator. Use substring instead.

  • MySQL does not support the intersect and except set operations.

  • MySQL (version 4.0 and later) does not support string table aliases unless the server is started with ANSI_QUOTES enabled.