I'm having trouble transferring Unicode strings from one MySQL database to another using DatabaseLink` functions. Here is my failed attempt to read a string from one database and insert it into another:

SQLSelect[conn["source"], "users", {"user_name"}, SQLColumn["user_id"] == 56]
(* {{"Дмитрий"}} *)

SQLUpdate[conn["target"], "users", {"user_name"}, {%[[1, 1]]}, SQLColumn["user_id"] == 56];

SQLSelect[conn["target"], "users", {"user_name"}, SQLColumn["user_id"] == 56]
(* {{"???????"}} *)

Any ideas on how to do this correctly? Thanks!

  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    Commented May 16, 2016 at 16:58

1 Answer 1


Based on this answer, I solved the issue by adding "Properties" -> {"characterEncoding" -> "UTF-8"} to the connection:

conn = OpenSQLConnection[JDBC["mysql", "localhost:3306/test"], 
  "Username" -> user, "Password" -> pwd, 
  "Properties" -> {"characterEncoding" -> "UTF-8"}]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.