Changing params

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mieszkom
Posts: 3
Joined: Sat 25 Apr 2009 05:56

Changing params

Post by mieszkom » Sat 15 Dec 2012 17:28

Hi,
is any way to programtycaly change DB params by MyServerControl?

AndreyZ

Re: Changing params

Post by AndreyZ » Mon 17 Dec 2012 13:51

Hello,

Please specify the exact database parameters that you want to change.

mieszkom
Posts: 3
Joined: Sat 25 Apr 2009 05:56

Re: Changing params

Post by mieszkom » Tue 18 Dec 2012 07:14

There are global parameters like server_id or max_allowed_packet. When I execute included in help statement:

Code: Select all

MyServerControl1.Variables['max_allowed_packet'] := '1234567890';
I get an error: #HY000SESSION variable 'max_allowed_packet' is read only. Use SET GLOBAL to assign a value.

SQL command using TMyScript "set global ...." works but I want to use TMyServerControl because it looks easier.

AndreyZ

Re: Changing params

Post by AndreyZ » Tue 18 Dec 2012 10:31

To avoid the problem, you should specify the scope of a variable in the variable name. Here is a code example:

Code: Select all

MyServerControl1.Variables['global max_allowed_packet'] := '1234567890';

mieszkom
Posts: 3
Joined: Sat 25 Apr 2009 05:56

Re: Changing params

Post by mieszkom » Tue 18 Dec 2012 11:16

It works, tkank you very much :)

AndreyZ

Re: Changing params

Post by AndreyZ » Tue 18 Dec 2012 11:56

I am glad I could help.

Post Reply