Dumping and importing with backslash
If you use mysqldump to export your data it will take care of this for you. For example:

mysql&gt; select * from table1;
+------+-------------+
| id   | mystr       |
+------+-------------+
|    1 | \frac{1}{2} |
+------+-------------+

mysqldump -uroot -p database1 table1 &gt; table1.sql

cat table1.sql | grep VALUES
INSERT INTO `table1` VALUES (1,'\\frac{1}{2}');


notice the escaped backslash? and:

mysql -uroot -p database1 &lt; table1.sql

mysql -uroot -p database1 -e "select * from table1"
Enter password: 
+------+-------------+
| id   | mystr       |
+------+-------------+
|    1 | \frac{1}{2} |
+------+-------------+