I have an end-user that is requesting I enable the NO_BACKSLASH_ESCAPES
server SQL Mode. He actually only has access to a single database. Am I able to enable this option only to his specific database? If not and it is global, what kind of repercussions will there be? Since it disables backslashes I am concerned would this effect other PHP programs on the web server.
Asked
Active
Viewed 2,850 times
1

Jon Weinraub
- 397
- 1
- 8
- 18
1 Answers
4
Repercussions
Both the MariaDB and the MySQL documentation state the same thing:
NO_BACKSLASH_ESCAPES Disables using the backslash character \ as an escape character within strings, making it equivalent to an ordinary character.
So this would definitely have unwanted repercussions as a global setting.
Global VS Session
The variable can be set on the specific session so that it is not global. E.g.
SET @@SQL_MODE = CONCAT(@@SQL_MODE, ',NO_BACKSLASH_ESCAPES');
Also, if you do ever set it globally, the setting will revert after a restart, see: setting global sql_mode in mysql
Reference

Menelaos
- 23,508
- 18
- 90
- 155