Docs for connecting to external DB

Need help? Post your questions here.
Posts: 1
Joined: 16 Dec 2016, 14:58
Has thanked: 0
Been thanked: 0

Docs for connecting to external DB

Unread post by tobel »

Hi Everyone,

I got quite excited when I saw that the "compare" page on the madsonic website (/pages/compare.jsp) mentions that madsonic 6.1.x supports external database support, so I set up an instance of the latest stable 6.1 build (6.1.8700) but

I can't find any documentation that details how to go about connecting to an external DB.

I read the help and have added the following parameter to my MADSONIC_ARGS: --db=jdbc:postgresql://localhost:5432/madsonic?user=DBUSER&password=MYPASS" but the system doesn't even try to log in to my DB.

I configured postgres with "log_connections = on", and every connection to the DB shows up in my log file, but there is no attempt by the madsonic user.

I've looked through all of the installation docs, and I can't seem to find anything about actually installing into an external DB.

If I've missed something obvious, my humble apologies!

Thanks in advance...

Posts: 51
Joined: 10 Sep 2015, 01:47
Has thanked: 6 times
Been thanked: 17 times

Re: Docs for connecting to external DB

Unread post by garyo »

I'd like to know this too.

Posts: 1
Joined: 08 Dec 2018, 11:54
Has thanked: 0
Been thanked: 0

Re: Docs for connecting to external DB

Unread post by Marbug »


I'm using the following package: ... one.tar.gz
Stating version: 6.2.9080

I'm trying to set it up too, I tried with the following option:

Code: Select all

MADSONIC_OPTS="--home=${MADSONIC_HOME} --port=${MADSONIC_PORT} --https-port=${MADSONIC_HTTPS_PORT} --pidfile=${PIDFILE} --db=${MADSONIC_DB} --quiet"
Where --db is passed as the following to java:

Code: Select all

but it throws me the following error:
[2018-12-08 10:12:52,389] INFO MySqlDaoHelper - Checking MySQL database schema.
[2018-12-08 10:12:52,768] INFO MySqlSchema01 - Database table 'version' not found. Creating it.
[2018-12-08 10:12:52,779] ERROR MySqlDaoHelper - Failed to initialize database.
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'the_internal_madsonic_host' (using password: YES))
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(
at org.springframework.jdbc.core.JdbcTemplate.execute(
at org.springframework.jdbc.core.JdbcTemplate.execute(
at org.madsonic.dao.schema.mysql.MySqlSchema01.execute(
at org.madsonic.dao.MySqlDaoHelper.checkDatabase(
at org.madsonic.dao.MySqlDaoHelper.<init>(
at org.madsonic.dao.DaoHelperFactory.create(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
Caused by: java.sql.SQLException: Access denied for user 'root'@'the_internal_madsonic_host' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(
at com.mysql.jdbc.MysqlIO.doHandshake(
at com.mysql.jdbc.ConnectionImpl.coreConnect(
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(
at com.mysql.jdbc.ConnectionImpl.createNewIO(
at com.mysql.jdbc.ConnectionImpl.<init>(
at com.mysql.jdbc.JDBC4Connection.<init>(
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at com.mysql.jdbc.Util.handleNewInstance(
at com.mysql.jdbc.ConnectionImpl.getInstance(
at com.mysql.jdbc.NonRegisteringDriver.connect(
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(
... 74 more
So it seems that the connectionstring is set, but wrong, I'm not connecting with the root user, and the host to where it wants to connect is the host from the VM I'm using and not the one from my configured instance.

I see that there is no reaction on the above, and that it will work with the version that I try.

Post Reply