我正在流程中添加数据库连接器。但在触发流程时出错。
anypoint studio version: 6.6.0
mysql version: 8.0.16
connector: mysql-connector-java-5.1.47.jar(also tried with mysql-connector-java-8.0.16.jar)
Error:
ERROR 2019-05-06 14:32:16,164 [[assignment1].HTTP_Listener_Configuration.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : org.mule.module.db.internal.domain.connection.ConnectionCreationException: Cannot get connection for URL jdbc:mysql://localhost:3306/mulesoft : Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property. (java.sql.SQLException)
Payload : org.glassfish.grizzly.utils.BufferInputStream@763af188
Element : /MySQL_Configuration @ app:assignment1.xml:11 (MySQL Configuration)
Element XML : <db:select config-ref="MySQL_Configuration" doc:name="Database">
<db:parameterized-query>select * from employee;</db:parameterized-query>
</db:select>
--------------------------------------------------------------------------------
Root Exception stack trace:
java.sql.SQLException: Cannot get connection for URL jdbc:mysql://localhost:3306/mulesoft : Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
在我要查询的数据库连接器中:从员工中选择*; 代码:
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<db:mysql-config name="MySQL_Configuration" host="localhost" port="3306" user="root" password="root12345" database="mulesoft" doc:name="MySQL Configuration"/>
<flow name="assignment1Flow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/employee" doc:name="HTTP"/>
<db:select config-ref="MySQL_Configuration" doc:name="Database">
<db:parameterized-query><![CDATA[select * from employee]]></db:parameterized-query>
</db:select>
<logger level="INFO" doc:name="Logger"/>
</flow>