MySQL Server Questions (FireDAC)

From RAD Studio
Jump to: navigation, search

Go Up to FAQ (FireDAC)

This topic contains a list of questions and answers related to MySQL Server.

Q1: Is there a way to use MySQL C API function mysql_thread_id from FireDAC?

A: Yes, although a bit cryptic:

  • FDConnection1.ConnectionIntf.Driver.CliObj - returns a reference to TMySQLLib;
  • FDConnection1.ConnectionIntf.CliObj - returns a reference to TMySQLSession, which has MySQL property;
  • all together:
uses
  FireDAC.Phys.MySQLCli, FireDAC.Phys.MySQLWrapper;
...
  with FDConnection1.ConnectionIntf do
    TMySQLLib(Driver.CliObj).mysql_thread_id(TMySQLSession(CliObj).MySQL);

Q2: Updating BLOB field with data greater than 512 KB on MySQL causes "MySQL server has gone away" error

A: Please see http://dev.mysql.com/doc/refman/5.0/en/gone-away.html, which suggests to increase max_allowed_packet.

Q3: Is it possible to establish a SSL connection to a MySQL server?

A: Yes, it is possible. See Connect to MySQL Server, Using a Secure Connection.

Q4: Why does the application hang for a few seconds at exiting? I am using only MySQL connection

A: If your application creates threads, this issue is possible with libmysql.dll v5.x. Please see http://bugs.mysql.com/bug.php?id=37226 for details. As a workaround, try to terminate all threads before terminating the application.