• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 558
  • Last Modified:

mySQL 5 - Can't insert escaped characters due to "no_backslash_escapes" setting

I just created a database on my new mySQL 5 DB and started adding tables from a previous version SQL dump. I am receiving errors around INSERTS with escaped characters \'95,98,ME\'

LOCK TABLES `script_os` WRITE;
INSERT INTO `script_os` VALUES (1,'All Windows Versions','if(true)\n($func)'),(2,'Windows 9x','if(CheckOperatingSystem(\'95,98,ME\'))\n($func)'),(3,'Windows NT','if(CheckOperatingSystem(\'XP,2000,NT4,2003\'))\n($func)');
UNLOCK TABLES;

Am I missing something? I need to insert this progrmatically into the DB so I need for this to work rather than creating new escape keys. I understand the reason was to prevent SQL Injection but surely I am not the only one having issues with this? I searched and found a few articles only.

Thanks for any insight you can provide.
G
0
FUROG
Asked:
FUROG
  • 2
1 Solution
 
hernst42Commented:
replace all the \' with '' and try again
0
 
FUROGAuthor Commented:
even on the newlines \n ?
0
 
FUROGAuthor Commented:
ok, got it...the /n is good.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now