unable to connect to remote mysql server

920 views
Skip to first unread message

Scott Cochran

unread,
Aug 3, 2020, 1:28:02 PM8/3/20
to rundeck-discuss
I'm trying to connect to a mysql db on another server, and getting the following errors in the rundeck.log:
WARN  internal.JdbcEnvironmentInitiator [main] - HHH000341: Could not obtain connection metadata : Could not create connection to database server. Attempted reconnect 3 times. Giving up.

and the service.log:
ERROR pool.ConnectionPool - Unable to create initial connections of pool.
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) ~[mysql-connector-java-8.0.21.jar!/:8.0.21]

java -version
openjdk version "1.8.0_252"

/etc/rundeck/rundeck-config.properties:
<snip>
dataSource.dbCreate = update
#dataSource.url=jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true
dataSource.url=jdbc:mysql://<remote host ip address>/rundeck?autoReconnect=true&useSSL=false&serverTimezone=EST&allowPublicKeyRetrieval=true
dataSource.username=<myuser>
dataSource.password=<mypassword>
dataSource.driverClassName=com.mysql.cj.jdbc.Driver

Grants on mysql db:
GRANT USAGE ON *.* TO '<myuser>'@'%'
GRANT ALL PRIVILEGES ON '<myuser'.* TO '<myuser>'@'%'

I've verified my ability to log into the db with user/password combo from my laptop, and I get a connection from the rundeck server to the mysql db:port with telnet
Any help would be appreciated.  I've been at this for hours now.


rac...@rundeck.com

unread,
Aug 3, 2020, 1:35:51 PM8/3/20
to rundeck-discuss
Hi Scott,

Did you follow these steps to create the rundeck database on MySQL?

Also, you can test with a more simple configuration like this.

Greetings.

Scott Cochran

unread,
Aug 3, 2020, 3:07:28 PM8/3/20
to rundeck-discuss
Thanks, for the reply.   
I had followed all of the steps in the rundeck guides, but the issue was with mysql remote login.  I was able to login using mysql workbench from my laptop, but after installing mysql on the rundeck server and trying a remote connection from there, I found that I was getting an access failure.  I'm still not sure why the GUI worked remotely, but at least it's resolved.

Reply all
Reply to author
Forward
0 new messages