MySQL install issue regarding ConvertGuid function Options
GlennSorensen
Posted: Saturday, April 19, 2008 12:18:54 AM
Rank: Newbie

Joined: 4/18/2008
Posts: 3
Hi folks,

Using the 32294 revision from codeplex i'm having an MySQL install issue when trying to do a fresh install at my web hosting (www.web10.dk).

The fresh install worked like a charm when I did it on my local machine.

I think the issue is about privileges in MySQL but I'm not sure.

I've broken the error down to the origin of the first line of the "Total.sql" script is creating a function called ConvertGuid.
CREATE FUNCTION ConvertGuid(guid CHAR(37)) RETURNS CHAR(37) RETURN guid;

When executing this line in "MySQL Query Browser" against my database at my web hosting it gives this error (which conforms to the MySQL Exception from the install):
This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

If I add one of the 'NO SQL', 'READS SQL DATA' or 'DETERMINISTIC' to the function like:
CREATE FUNCTION ConvertGuid(guid CHAR(37)) RETURNS CHAR(37) READS SQL DATA RETURN guid;

It instead gives this error:
You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

I've tried to execute this function on a local db with user privileges only to the specific database (as I excpect the privileges is at my web hosting), and this works fine.

Maybe it has something to do with binary logging instead of privileges?

As far as I can tell binary logging is enabled in MySQL at my web hosting, but not on my local MySQL installation.

I'm quite new to MySQL so if anyone could please confirm if this error is privilege related or not, and maybe give a hint or two?

Best regards
Glenn
GlennSorensen
Posted: Tuesday, April 22, 2008 10:52:24 PM
Rank: Newbie

Joined: 4/18/2008
Posts: 3
Okay I figured it out, so here comes the explanation to anyone else who might bump into this issue.

The problem is kind of privilege related, but merely because binary logging is enabled.

When binary logging is enabled, then it sometimes requires SUPER privilege to create a stored function. To bypass this while retaining the binary logging, there is a global variable named 'log_bin_trust_function_creators' which can be set to '1'. Default value is '0'

In sql it is done like this:
mysql> SET GLOBAL log_bin_trust_function_creators = 1;

Or you can supply an option when starting the MySQL server

Further information can be found here:
http://dev.mysql.com/doc/refman/5.1/en/stored-procedure-logging.html

Best regards
Glenn
Ruben
Posted: Monday, May 12, 2008 11:49:00 PM

Rank: Aficionado

Joined: 12/21/2007
Posts: 143
Location: Belgium
Hi Glenn,

Thanks for your research!

Regards,

Ruben

Ruben Verborgh | Umbraco Core Team Developer | Working on: Data layer table utility. | LinkedIn
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.