Connect to MySQL Server (AnyDAC)

From RemObjects Software

Jump to: navigation, search

This is a AnyDAC Database Connectivity entry
Feel free to add your notes to this topic below.



Supported versions

The AnyDAC native driver supports MySQL Server Community and Enterprise editions version 3.21 and higher.


Client software

AnyDAC requires the LIBMYSQL.DLL client library. Ideally, its version should be equal to the server version. You can take it from the server's distribution Bin folder or download from here.


Connection definition parameters

DriverID=MySQL

Parameter

Description

Example value

Host

The TCP/IP address of the server running a MySQL server. 

127.0.0.1

Port

The TCP/IP port on which MySQL server is listening.

3306

Database

Name of the current database for the connection. If Database is not specified, then no current database is setup.

MYDB

UserName

The MySQL user ID.

Root

Password

The MySQL user password

CharacterSet

The default character set for the connection. The connection collation becomes the default collation of the character set. See SET NAMES statement for details.

cp1251

Compress

Specify True to enable network trafic compression. By default is False.

LoginTimeout

Controls the amount of time in seconds an application waits for a connection attempt to timeout while waiting to establish a connection.

30

ResultMode

Controls how to fetch result set to a client. Default value is Store.

  • Store - fetches all rows right after quesry execution and stores them on a client, making the server process ready for new requests.
  • Use - rows will be fetched on demand of a client. While not all rows from result set are fetched, the server cannot handle new requests. It allows to reduce memory usage on very big result sets.
  • Choose - AnyDAC will automatically choose mode. If FetchOption.Mode is one of fmAll, fmExactRecsMax, then "Store", otherwise "Use".

Use

MetaDefCatalog

Default database name. Design time code will exclude catalog name from object name, if it is equal to MetaDefCatalog. Setting MetaDefCatalog does not change current database in MySQL session.

MyDB


Usage cases

  • Connect to a server running locally, listening on the default (3306) port

DriverID=MySQL
Database=addemo
  • Connect to a remote server, listening on a non-default port, using Unicode for character data

DriverID=MySQL
Server=mysrv
Port=3307
Database=addemo
CharacterSet=utf8


See Also


Product: RemObjects AnyDAC
Current version: AnyDAC 2.0

GlossaryFeaturesHow ToComponentsToolsSamplesArticlesArchitectureIssues

Personal tools