Reputation: 10342
I am trying to set the charset when letting Matlab connect to remote mysql database server.
The connection url is like this:
jdbc:mysql://host/mtdb?useUnicode=true&characterEncoding=UTF8
And after executing:
c = database("mydb", 'username', 'password','com.mysql.jdbc.Driver', "connection_string as above");
But Matlab throws an exception:
'Unsupported character encoding 'UTF8mydb'.
I cannot see why character encoding is appended with "mydb"
. I don't see any syntax error in the connection url format.
Upvotes: 1
Views: 1058
Reputation: 124563
Try this instead:
dbURL = 'jdbc:mysql://localhost/mydb?useUnicode=true&characterEncoding=UTF8';
conn = database('', 'user', 'pass', 'com.mysql.jdbc.Driver', dbURL)
curs = exec(conn, 'select * from table')
Upvotes: 1