MySQL Connector/C++ 1.1 Developer Guide

Chapter 10 Connector/C++ Connection Options

To connect to a MySQL server from Connector/C++ applications, use the connect() method of the MySQL_Driver class. The connect() method has two calling sequences:

The hostName parameter can be a host name, IP address, or URL.

For a host name or IP address by itself, Connector/C++ makes a TCP/IP connection to the named host. If the host name is localhost, Connector/C++ interprets it as 127.0.0.1.

For a hostName value specified as a URL, the format begins with a connection protocol and the protocol determines the syntax of the remaining part of the URL:

For the connect() syntax that takes an option map argument, Connector/C++ supports the connection properties described in the following list.

Note

Many of these properties correspond to arguments for the mysql_options(), mysql_options4(), or mysql_real_connect(), C API function. For such properties, the descriptions here are brief. For more information, refer to the descriptions for those functions. See mysql_options(), mysql_options4(), and mysql_real_connect().