web stats
MySQL "Could not create connection..." - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-03-2018, 07:32 AM
ypiisupport ypiisupport is offline
Mirth Newb
 
Join Date: May 2018
Posts: 6
ypiisupport is on a distinguished road
Default MySQL "Could not create connection..."

Hi. With fresh install of MIRTH Connect 3.5.2, MySQL 8.0 on Windows 2016 server, I'm unable to connect to MySQL using this string in the server manager: "jdbc:mysql://localhost:3306/mirthdb".
I have a local instance of mirthdb running, a "mirthuser" account with full permissions. I am able to login to the mirthdb from MySQL workbench ok. There is nothing in the MySQL log showing any communication from MIRTH. I am trying to use MySQL instead of Derby. Any ideas would be helpful! Thanks.
Here is the error log:

INFO 2018-04-27 14:13:08,521 [Main Server Thread] com.mirth.connect.server.Mirth: Mirth Connect 3.5.2 (Built on March 16, 2018) server successfully started.
INFO 2018-04-27 14:13:08,521 [Main Server Thread] com.mirth.connect.server.Mirth: This product was developed by Mirth Corporation (http://www.mirthcorp.com) and its contributors (c)2005-2018.
INFO 2018-04-27 14:13:08,521 [Main Server Thread] com.mirth.connect.server.Mirth: Running Java HotSpot(TM) 64-Bit Server VM 1.8.0_172 on Windows Server 2016 (10.0, amd64), derby, with charset windows-1252.
INFO 2018-04-27 14:13:08,538 [Main Server Thread] com.mirth.connect.server.Mirth: Web server running at http://10.1.2.19:8080/ and https://10.1.2.19:8443/
INFO 2018-04-27 14:16:34,463 [Shutdown Hook Thread] com.mirth.connect.server.Mirth: shutting down mirth due to normal request
ERROR 2018-04-27 14:16:43,382 [Main Server Thread] com.mirth.connect.server.Mirth: Error establishing connection to database, aborting startup. Could not create connection to database server.
INFO 2018-04-27 14:16:43,382 [Shutdown Hook Thread] com.mirth.connect.server.Mirth: shutting down mirth due to normal request
ERROR 2018-04-27 14:16:43,413 [Shutdown Hook Thread] com.mirth.connect.server.controllers.DefaultConfig urationController: Could not retrieve property: category=core, name=channelDependencies
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientC onnectionException: Could not create connection to database server.
### The error may exist in mysql/mysql-configuration.xml
### The error may involve Configuration.selectProperty
### The error occurred while executing a query
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientC onnectionException: Could not create connection to database server.
at org.apache.ibatis.exceptions.ExceptionFactory.wrap Exception(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSessi on.selectList(DefaultSqlSession.java:104)
at org.apache.ibatis.session.defaults.DefaultSqlSessi on.selectList(DefaultSqlSession.java:95)
at org.apache.ibatis.session.defaults.DefaultSqlSessi on.selectOne(DefaultSqlSession.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.ibatis.session.SqlSessionManager$SqlSes sionInterceptor.invoke(SqlSessionManager.java:282)
at com.sun.proxy.$Proxy6.selectOne(Unknown Source)
at org.apache.ibatis.session.SqlSessionManager.select One(SqlSessionManager.java:151)
at com.mirth.connect.server.controllers.DefaultConfig urationController.getProperty(DefaultConfiguration Controller.java:903)
at com.mirth.connect.server.controllers.DefaultConfig urationController.getChannelDependencies(DefaultCo nfigurationController.java:1007)
at com.mirth.connect.server.util.ChannelDependencySer verUtil.getDependencyGraph(ChannelDependencyServer Util.java:26)
at com.mirth.connect.server.util.ChannelDependencySer verUtil.getOrderedChannels(ChannelDependencyServer Util.java:30)
at com.mirth.connect.server.controllers.DonkeyEngineC ontroller.undeployChannels(DonkeyEngineController. java:405)
at com.mirth.connect.server.controllers.DonkeyEngineC ontroller.stopEngine(DonkeyEngineController.java:2 25)
at com.mirth.connect.server.Mirth.stopEngine(Mirth.ja va:362)
at com.mirth.connect.server.Mirth.shutdown(Mirth.java :318)
at com.mirth.connect.server.Mirth$ShutdownHook.run(Mi rth.java:432)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientC onnectionException: Could not create connection to database server.
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:40 8)
at com.mysql.jdbc.Util.getInstance(Util.java:383)
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:1023)
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:997)
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:983)
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:928)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(Co nnectionImpl.java:2576)
at com.mysql.jdbc.ConnectionImpl.createNewIO(Connecti onImpl.java:2309)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImp l.java:834)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connect ion.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:40 8)
at com.mysql.jdbc.ConnectionImpl.getInstance(Connecti onImpl.java:419)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:344)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.ibatis.datasource.unpooled.UnpooledData Source.doGetConnection(UnpooledDataSource.java:181 )
at org.apache.ibatis.datasource.unpooled.UnpooledData Source.doGetConnection(UnpooledDataSource.java:176 )
at org.apache.ibatis.datasource.unpooled.UnpooledData Source.getConnection(UnpooledDataSource.java:80)
at org.apache.ibatis.datasource.pooled.PooledDataSour ce.popConnection(PooledDataSource.java:371)
at org.apache.ibatis.datasource.pooled.PooledDataSour ce.getConnection(PooledDataSource.java:80)
at org.apache.ibatis.transaction.jdbc.JdbcTransaction .openConnection(JdbcTransaction.java:131)
at org.apache.ibatis.transaction.jdbc.JdbcTransaction .getConnection(JdbcTransaction.java:58)
at org.apache.ibatis.executor.BaseExecutor.getConnect ion(BaseExecutor.java:279)
at org.apache.ibatis.executor.SimpleExecutor.prepareS tatement(SimpleExecutor.java:69)
at org.apache.ibatis.executor.SimpleExecutor.doQuery( SimpleExecutor.java:56)
at org.apache.ibatis.executor.BaseExecutor.queryFromD atabase(BaseExecutor.java:267)
at org.apache.ibatis.executor.BaseExecutor.query(Base Executor.java:141)
at org.apache.ibatis.executor.CachingExecutor.query(C achingExecutor.java:105)
at org.apache.ibatis.executor.CachingExecutor.query(C achingExecutor.java:81)
at org.apache.ibatis.session.defaults.DefaultSqlSessi on.selectList(DefaultSqlSession.java:101)
... 18 more
Caused by: java.lang.NullPointerException
at com.mysql.jdbc.ConnectionImpl.getServerCharset(Con nectionImpl.java:3299)
at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(My sqlIO.java:1967)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggab leAuthentication(MysqlIO.java:1893)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:12 87)
at com.mysql.jdbc.ConnectionImpl.coreConnect(Connecti onImpl.java:2494)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(Co nnectionImpl.java:2527)
... 45 more
Reply With Quote
  #2  
Old 05-16-2018, 06:41 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 277
AlexNeiva is on a distinguished road
Default

Hello,

recheck carefully the hostname, port and credentials!
Check on the DB server in which port the DB is running.
__________________
Best Regards,
Alex Neiva
Reply With Quote
  #3  
Old 05-18-2018, 01:28 PM
ypiisupport ypiisupport is offline
Mirth Newb
 
Join Date: May 2018
Posts: 6
ypiisupport is on a distinguished road
Default MIRTH can't connect to MySQL

Thank you, Alex. I have verified the MySQL credentials, DB name, and port, but MIRTH server doesn't connect. I am wondering if MIRTH server is getting stuck before the DB authentication initiates? I can connect to the MySQL MIRTH DB from MYSQL workbench no problem. By the way, this is a fresh install of MIRTH 3.5.2 and using a 3.4 configuration import. The MIRTH admin loads fine when I choose "Derby", but I'd like to use MySQL instead.
Eric
Reply With Quote
  #4  
Old 05-20-2018, 08:53 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 857
agermano is on a distinguished road
Default

Are you also connecting to localhost with mysql workbench?
Reply With Quote
  #5  
Old 05-21-2018, 01:44 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 277
AlexNeiva is on a distinguished road
Default

Hello,


check this error "The error may exist in mysql/mysql-configuration.xml"
__________________
Best Regards,
Alex Neiva
Reply With Quote
  #6  
Old 05-21-2018, 12:27 PM
ypiisupport ypiisupport is offline
Mirth Newb
 
Join Date: May 2018
Posts: 6
ypiisupport is on a distinguished road
Default

Thank you. Yes, agermano, I am connecting with workbench fine.

Alex- I've looked at this error "The error may exist in mysql/mysql-configuration.xml", but there is no such file in my installation of mysql.

The my.ini file settings show port set to 3306 and
# Path to the database root
datadir=C:/ProgramData/MySQL/MySQL Server 8.0/Data

Again, there is no record in the mysql general log of any attempt by the mirth user to connect!
Reply With Quote
  #7  
Old 05-21-2018, 12:52 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 857
agermano is on a distinguished road
Default

I know you are connecting from workbench fine. Is it installed on the mirth server? When you set up your connection are you connecting to localhost?
Reply With Quote
  #8  
Old 05-21-2018, 01:23 PM
ypiisupport ypiisupport is offline
Mirth Newb
 
Join Date: May 2018
Posts: 6
ypiisupport is on a distinguished road
Default workbench

Yes, I have workbench installed on the MIRTH server. It has 2 separate connections- one as "root" to localhost, and the other as "mirthdb" to 127.0.0.1. The MIRTH connection is set to user "mirthdb" and this string: jdbc:mysql://localhost:3306/mirthdb
Thank you.
Reply With Quote
  #9  
Old 05-22-2018, 08:06 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 857
agermano is on a distinguished road
Default

mysql is really picky about user/host names. Have you tried connecting to "jdbc:mysql://127.0.0.1:3306/mirthdb" from mirth?
Reply With Quote
  #10  
Old 05-22-2018, 08:15 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 857
agermano is on a distinguished road
Default

https://stackoverflow.com/questions/...-0-0-1/3715946

localhost and 127.0.0.1 are not the same thing. When you connect from mysql workbench, are you connecting as the mirthdb user to localhost?

You might want to try to set up your mirthdb user at localhost instead of 127.0.0.1.

If you stick with 127.0.0.1, I think you need to make sure that your mysql server is listening on that interface.
Reply With Quote
Reply

Tags
connection, mysql

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:18 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation