简体   繁体   中英

Connecting MySQL to JasperReports Server

I'm trying to connect my JasperReports Server to a remote MySQL server. I'm pretty sure I have the driver in the right place (as it shows up as an option in the JR Server dashboard). Here's the dashboard:

在此处输入图片说明

Here's the error I'm getting:

java.sql.SQLNonTransientConnectionException: Could not connect to 54.213.92.113:3306 : 
Connection refused at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:136) 
at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106) 
at org.mariadb.jdbc.Driver.connect(Driver.java:114) at java.sql.DriverManager.getConnection(DriverManager.java:571) 
at java.sql.DriverManager.getConnection(DriverManager.java:215) 
at com.jaspersoft.jasperserver.war.action.DataSourceAction.testJdbcDataSource(DataSourceAction.java:482) 

Does anyone have any idea as to how to solve this problem?

You need to give privileges to the user that you want to connect:

check with show privileges

+-----------------+------------+
| Host            | User       |
+-----------------+------------+
| %               | username   |
| localhost       | username   |
+-----------------+------------+

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM