Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FireDac Connection to MySQL


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Jul 1, 2015 11:45 AM Last Post By: Remy Lebeau (Te...
Philip Jackson

Posts: 18
Registered: 6/14/01
FireDac Connection to MySQL  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 27, 2015 5:23 AM
Hi

I have a FD connection to a MySQL database, everything works OK.

I now want to move this to a customer machine but the properties mySQLConnection.Params of

.server and .port do not appear to be able to be configured when my application starts.

How do I set these parameters at run time?

Thanks for looking

Philip L Jackson
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: FireDac Connection to MySQL  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 27, 2015 5:42 PM   in response to: Philip Jackson in response to: Philip Jackson
Philip wrote:

I have a FD connection to a MySQL database, everything works OK.

I now want to move this to a customer machine but the properties
mySQLConnection.Params of

.server and .port do not appear to be able to be configured when my
application starts.

Yes, they are.

How do I set these parameters at run time?

The FireDAC documentation explains in detail exactly how to do it:

Defining Connection (FireDAC)
http://docwiki.embarcadero.com/RADStudio/XE8/en/Defining_Connection_(FireDAC)

Connect to MySQL Server (FireDAC)
http://docwiki.embarcadero.com/RADStudio/XE8/en/Connect_to_MySQL_Server_(FireDAC)

Read that documentation very carefully. It focuses alot on using configuration
files, but it also does explain how to set the parameters in code at runtime,
and which parameters can be set for MySQL.

--
Remy Lebeau (TeamB)
Philip Jackson

Posts: 18
Registered: 6/14/01
Re: FireDac Connection to MySQL  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 28, 2015 2:59 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Philip wrote:

I have a FD connection to a MySQL database, everything works OK.

I now want to move this to a customer machine but the properties
mySQLConnection.Params of

.server and .port do not appear to be able to be configured when my
application starts.

Yes, they are.

How do I set these parameters at run time?

The FireDAC documentation explains in detail exactly how to do it:

Defining Connection (FireDAC)
http://docwiki.embarcadero.com/RADStudio/XE8/en/Defining_Connection_(FireDAC)

Connect to MySQL Server (FireDAC)
http://docwiki.embarcadero.com/RADStudio/XE8/en/Connect_to_MySQL_Server_(FireDAC)

Read that documentation very carefully. It focuses alot on using configuration
files, but it also does explain how to set the parameters in code at runtime,
and which parameters can be set for MySQL.

--
Remy Lebeau (TeamB)

Thanks for the advice and prompt reply

I am comfortable with the configuration files so I used that option.

I also found the following demo useful.

C:\Users\Public\Documents\Embarcadero\Studio\16.0\Samples\Object Pascal\Database\FireDAC\Samples\Comp Layer\TFDConnection


Many Thanks

Philip L Jackson

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: FireDac Connection to MySQL  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 1, 2015 11:45 AM   in response to: Philip Jackson in response to: Philip Jackson
Philip wrote:

I have a FD connection to a MySQL database, everything works OK.

I now want to move this to a customer machine but the properties
mySQLConnection.Params of

.server and .port do not appear to be able to be configured when my
application starts.

Yes, they are.

How do I set these parameters at run time?

The FireDAC documentation explains in detail exactly how to do it:

Defining Connection (FireDAC)
http://docwiki.embarcadero.com/RADStudio/XE8/en/Defining_Connection_(FireDAC)

Connect to MySQL Server (FireDAC)
http://docwiki.embarcadero.com/RADStudio/XE8/en/Connect_to_MySQL_Server_(FireDAC)

Read that documentation very carefully. It focuses alot on using configuration
files, but it also does explain how to set the parameters in code at runtime,
and which parameters can be set for MySQL.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02