dbTalk Databases Forums  

Session Variable Non-Override

comp.databases.mysql comp.databases.mysql


Discuss Session Variable Non-Override in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brian Smither
 
Posts: n/a

Default Session Variable Non-Override - 12-25-2011 , 03:54 PM






Q: How can I make a database be strict about accepting valid data?
A: In the config file for the server, find and edit to include
'STRICT_TRANS_TABLES' or 'STRICT_ALL_TABLES':
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_E NGINE_SUBSTITUTION"
This will be the default mode for all new connections.

Q: How can I override these settings on a per-session (per-client, per
connection) basis?
A: Issue this statement from the client:
SET @@sql-mode=[Whatever wanted, but don't include STRICT_x_TABLES]

Q: How can the database server administrator prevent the setting of this
variable by any client/user?

A: ????


--
Remove INVALID from e-mail address.

Brian Smither
Smither Consulting

Reply With Quote
  #2  
Old   
onedbguru
 
Posts: n/a

Default Re: Session Variable Non-Override - 12-26-2011 , 02:30 PM






On Dec 25, 4:54*pm, Brian Smither <bhsmitherINVA... (AT) INVALIDgmail (DOT) com>
wrote:
Quote:
Q: How can I make a database be strict about accepting valid data?
A: In the config file for the server, find and edit to include
'STRICT_TRANS_TABLES' or 'STRICT_ALL_TABLES':
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_E NGINE_SUBSTITUTION"
This will be the default mode for all new connections.

Q: How can I override these settings on a per-session (per-client, per
connection) basis?
A: Issue this statement from the client:
SET @@sql-mode=[Whatever wanted, but don't include STRICT_x_TABLES]

Q: How can the database server administrator prevent the setting of this
variable by any client/user?

A: ????

--
Remove INVALID from e-mail address.

Brian Smither
Smither Consulting

First of all, why in the world would you allow "users" direct access
to the database from a sql client? If you allow direct access, they
can do pretty much whatever they want. They should be connecting via
some form or other application that does not allow direct sql access
to the database...

You can use ENUM fields, you can have triggers that check for valid
data, you can have foreign keys that check for valid data... -
providing you are using a db engine that uses it (Innodb for
example).

Another good place to start is:
http://dev.mysql.com/doc/refman/5.1/en/grant.html

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.