java - How to pass session variables in JDBC url properly? -
I have to increase the group_concat_max_len I can not do this by prepaidment, and I can not even do it in mysql my.conf file .
I found on mysql documents that there is an option to pass the session variable in the URL. But there is no example, I tried to do this:
jdbc.url = jdbc: mysql: //xxxx.xx.xx.xx/dbName? SessionVariables = group_concat_max_len: 204800
and I have an exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: one in your SQL syntax Error is; Check the manual related to your MySQL server version for the correct syntax for using 'Nearest': 204800 'Line 1, and I also tried it like this: jdbc.url = jdbc: mysql: //xxxx.xx.xx.xx/dbName? SessionVariables = group_concat_max_len, 204800
Because the official document says:
sessionVariables names / values separated by a comma separated list as SET session Can be sent ... when the server connects the driver. Version: 3.1.8 to
Any ideas ???
Try it out:
jdbc.url = jdbc: mysql: //xxxx.xx.xx.xx/dbName? SessionVariables = group_concat_max_len = 204800
Comments
Post a Comment