Extracted from Pike v7.6 release 61 at 2005-12-30.
pike.ida.liu.se
[Top]
Mysql
Mysql.mysql

Method Mysql.mysql()->create()


Method create

void Mysql.mysql()
void Mysql.mysql(string host)
void Mysql.mysql(string host, string database)
void Mysql.mysql(string host, string database, string user)
void Mysql.mysql(string host, string database, string user, string password)
void Mysql.mysql(string host, string database, string user, string password, mapping(string:string|int) options)

Description

Connect to a Mysql database.

To access the Mysql database, you must first connect to it. This is done with this function.

Parameter host

If you give no argument, or give "" as host it will connect with a UNIX-domain socket, which can be a big performance gain.

Parameter options

This optional mapping can contain zero or more of the following parameters:

"init_command" : string

Command to execute on connect.

"timeout" : int

Timeout in seconds.

"compress" : int(0..1)

Enable compressed protocol.

"mysql_config_file" : string

Change config file from "my.cnf".

"mysql_group" : string

Specify additional group to read from config file.

"mysql_named_pipe" : int(0..1)

Use named pipe to connect to server.

"mysql_local_infile" : int(0..1)

Enable use of LOCAL INFILE (security).

"mysql_charset_dir" : string

Change charset directory.

"mysql_charset_name" : string

Change charset name.

"ssl_key" : string

Path to SSL-key for use in SSL-communication.

"ssl_cert" : string

Path to SSL-cert for use in SSL-communication.

"ssl_ca" : string

Path to SSL-CA for use in SSL-communication.

"ssl_capath" : string

Path to SSL-CAPATH for use in SSL-communication.

"ssl_cipher" : string

FIXME

"connect_options" : int

Options used when connecting to the server. See mysql documentation for more information.


Note

Some options may not be implemented. Unimplemented options are silently ignored.

To use SSL-connections, set the SSL-parameters correctly. They corespond to the parameters given to the mysql-client with the same name so make sure that the mysql-client works with SSL and set these parameters to the same values and everything should work. If SSL-options are loaded from a config-file, one may set the connect_options to include CLIENT_SSL.