Greg
Greg

Reputation: 7393

How to enable STRICT_ALL_TABLES' for single MySQL database?

Is there a way to enable STRICT_ALL_TABLES for a single MySQL database?

Upvotes: 5

Views: 5949

Answers (3)

s-sharma
s-sharma

Reputation: 2025

You can set the default SQL mode by starting mysqld with the --sql-mode="modes" option, or by using sql-mode="modes" in my.cnf (Unix operating systems) or my.ini (Windows). modes is a list of different modes separated by comma (“,”) characters. The default value is empty (no modes set). The modes value also can be empty (--sql-mode="" on the command line, or sql-mode="" in my.cnf on Unix systems or in my.ini on Windows) if you want to clear it explicitly.

ref MySql Website

Upvotes: 1

rgh
rgh

Reputation: 11

set sql_mode = 'STRICT_ALL_TABLES'; will do it.

Upvotes: 1

igelkott
igelkott

Reputation: 1287

Don't think you can do this directly but you might get close with setting Strict for the current session when working on a particular database. Could do this in the config files of specific users.

Upvotes: 0

Related Questions