Page 1 of 1

Access denied trying to use mysql

PostPosted: Mon Mar 05, 2018 8:12 pm
by Ernie_D
I've set the startup option as --db=jdbc:mysql://localhost:3306/subsonic?user=root&password=******&characterEncoding=UTF-8.

As described at http://www.subsonic.org/pages/database.jsp

The subsonic log reports:

Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: NO))


Do I need to configure the MySQL server, and if so, what do I need to change?

Thanks for any assistance.

Re: Access denied trying to use mysql

PostPosted: Tue Mar 06, 2018 1:11 pm
by toolman
Did you use MySQL version 5.6 or 5.7? (these are the versions that are tested...)
Did you create the empty database called "subsonic"?
Does your installation of MySQL really use port 3306?
If you're using Windows did you configure the firewall correctly?
Are you sure you are using the correct username and password for MySQL ?
The error seems to indicate that that's the problem.

Re: Access denied trying to use mysql

PostPosted: Mon Jun 22, 2020 8:00 pm
by stukafox
Hello,

Sorry for the forum necromancy, but I have the exact same problem.

>Did you use MySQL version 5.6 or 5.7? (these are the versions that are tested...)
$#>mysql --version
mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper

Did you create the empty database called "subsonic"?
Yes

Does your installation of MySQL really use port 3306?
Yes

If you're using Windows did you configure the firewall correctly?
I'm on Linux, and yes.

Are you sure you are using the correct username and password for MySQL ?
Yes.

JDBC URL:
SUBSONIC_ARGS='--https-port=24080 --max-memory=200 --db=jdbc:mysql://localhost:3306/subsonic?user=redacted&password=redacted&characterEncoding=UTF-8'

Head of stack trace in subsonic_sh.log:
Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'redacted'@'localhost' (u
sing password: NO)):
java.sql.SQLException: Access denied for user 'redacted'@'localhost' (using password: NO)

Any suggestion is welcome.

Thanks.

Re: Access denied trying to use mysql

PostPosted: Mon Jun 22, 2020 8:21 pm
by stukafox
Here is the solution to the problem -- this should be added to the instructions as they are currently incorrect: http://www.subsonic.org/pages/database.jsp

The JDBC MySQL URL needs to be as follows:

SUBSONIC_ARGS="--https-port=<port number> --max-memory=200 --db='jdbc:mysql://localhost:3306/subsonic?user=redacted&password=redacted&characterEncoding=UTF-8'"

Note the double-quotes, " , around the body of the SUBSONIC_ARGS= themselves and the SINGLE quote, ' , around the JDBC URL. If this format is not used, the password will not be passed to MySQL.

Thanks.