Friday, August 10, 2018

[google-cloud-sql-discuss] Re: How to set innodb_strict_mode = OFF globally in Cloud SQL

Hi, Katayoon.

I've tried it without success.

In this case I want to disable the innodb_strict_mode.

Thanks!

On Tuesday, August 7, 2018 at 7:21:52 PM UTC-3, Katayoon (Cloud Platform Support) wrote:

Hi Vinícius,


I should note that the feature request on 'enabling "innodb_strict_mode" by default' already exists in the Issue Tracker and you may star the case to receive updates on it.


For the time being, you may try the following steps to add the table to your database:


1.  Open your create_script.sql file with a text editor, and add one line above the "CREATE TABLE" line, the file should look like this afterwards:  Do not add the lines or the "..." , those are only meant to make it easier to see the file in this post.


-------------------------------------------------------------------------------

SET innodb_strict_mode = 0 ;


CREATE TABLE `history_data` (

 `id` bigint(20) NOT NULL AUTO_INCREMENT,

 `coffee` longtext,

 .....

-------------------------------------------------------------------------------


2.  Add the table to your database instance, replacing HOSTNAME with the hostname of the server, replacing DATABASE with the name of the database, and ensure that the path to the script is correct.


$ mysql -uroot -h HOSTNAME DATABASE < ~/path/to/create_script.sql


3.  Verify that the table has been created


--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/c3fca2bf-3ec8-46ba-8c6f-83f44b2a293d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment