Disabling MySQL Strict Mode

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
Kalan
New to forums
New to forums
Posts: 4
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun Apr 15, 2012 6:53 pm

Disabling MySQL Strict Mode

Post by Kalan »

I'm attempting to disable MySQL strict mode on my database by using this query:
SET @@global.sql_mode= '';

but I receive this error: #1227 - Access denied; you need the SUPER privilege for this operation

I've read that you can also edit a file, but I'm not seeing this file in my directory structure:
Open your "my.ini" file within the MySQL installation directory, and look for the text "sql-mode".
Find:
Code:

# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Replace with:
Code:

# Set the SQL mode to strict
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
Thanks.
User avatar
Edge100x
Founder
Founder
Posts: 13120
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Disabling MySQL Strict Mode

Post by Edge100x »

You can't change global variables or the global .ini file. Try setting it on a session basis instead:

SET @@SESSION.sql_mode= '';
Post Reply