I can't create functions

2,746 views
Skip to first unread message

Beto Custom

unread,
Oct 13, 2016, 1:22:28 PM10/13/16
to Google Cloud SQL discuss
Hi, i have the follow problem:
I created an instance, I connect to it from toad with the root user and launched a script to create all the objects in my database, tables, functions, procedures, etc. When creating the first function throws me the following error:

MySQL Database Error: You Do not have the SUPER privilege and binary logging is enabled (you * might * want to use the less safe Variable log_bin_trust_function_creators)

The binary logging is enabled and I can not disable via the console.
The root user also has the privilege "super".

What I can do?

thanks for your comments.

Carlos (Cloud Platform Support)

unread,
Oct 14, 2016, 11:26:57 AM10/14/16
to google-cloud...@googlegroups.com
Hi Beto,

It is important to note that Google Cloud SQL does not support SUPER privileges. The behavior is fully documented in our Cloud SQL FAQ. There are also some other unsupported features like ¨User defined functions¨. Nevertheless Stored Procedures are supported.

The log_bin_trust_function_creators MySQL flag controls whether stored function creators can be trusted or not to create stored functions that will cause unsafe events to be written to the binary log. By default in Cloud SQL its value is OFF meaning users are not permitted to create or alter stored functions, unless they have the 'SUPER privilege' which is not supported in Cloud SQL. 

As a workaround, you can set the log_bin_trust_function_creators to ON by running this gcloud sql command:

gcloud sql instances patch [INSTANCE_NAME] --database-flags log_bin_trust_function_creators=ON

Let me know if this helps. 

Beto Custom

unread,
Oct 17, 2016, 11:22:45 AM10/17/16
to Google Cloud SQL discuss
Well, I see it is not supported. is more, do not understand how is not supported creating tables. 
Then how the tables are created in the database?, And then as I can read the data if either the select is supported?

Unsupported statements for Second Generation instances

The following statements are not supported because Second Generation use GTID replication:

  • CREATE TABLE ... SELECT statements
  • CREATE TEMPORARY TABLE statements inside transactions
  • Transactions or statements that update both transactional and nontransactional tables

Carlos (Cloud Platform Support)

unread,
Oct 17, 2016, 4:04:00 PM10/17/16
to Google Cloud SQL discuss
¨CREATE TABLE¨ and ¨SELECT¨ statements are supported as used in this guide. The unsupported feature the document mentions is when you try to directly create a table from another using ¨CREATE TABLE …. SELECT¨ syntax.

Let me know if this clarifies. 

Eduardo Rippa

unread,
Jun 21, 2018, 12:58:07 PM6/21/18
to Google Cloud SQL discuss
Hi Carlos,

I tried your workaround but i haved this error 

"HTTPError 403: The client is not authorized to make this request"

you can help me

Amandeep Kaur(Cloud Platform Support)

unread,
Jul 4, 2018, 2:22:33 PM7/4/18
to Google Cloud SQL discuss
Hi Eduardo,

I understood you tried to update the instance and received an authorization error.

Most of the time this error occur because of typo in the gcloud command, make sure the instance name is correct.
Reply all
Reply to author
Forward
0 new messages