Database Connection Error - Access Denied

ctktech
New Contributor II

Hi! I just recently installed the newest update this month, and I am unable to get access back into the JSS. This is the error message I get when I try to access the site:

Database Connection Error

The following error was encountered:

QueryException: Could not connect: Access denied for user 'jamfsoftware'@'localhost' (using password: YES) - An error occurred while connecting to the database. Verify the username, password, and database name, then try again

Please verify the following items:
MySQL is running on localhost
MySQL is accepting network connections
The user jamfsoftware@localhost has been granted privileges to the jamfsoftware database

I am running the JSS and SQL server on the same Windows server, and I have verified that Tomcat and MySQL services are running. Unfortunately I cannot get access to the MySQL command prompt as I do not know the root password.

Any help would be appreciated.

Thanks!

12 REPLIES 12

PatrickD
Contributor II

Hi @ctktech, can you advise the exact JSS version you installed? eg 9.9X.XXXXXXXX and what you were on beforehand?

Cheers,
Pat

ctktech
New Contributor II

Current Version: 9.97.1488392992

Previous Version: 9.97.1482356336

Previous version worked just fine. The current version is the one that was just released this past weekend.

PatrickD
Contributor II

Hmm I feared that was the case. I would probably speak with Jamf if you haven't already incase it is a larger issue with the new Hotfix.

Can you logon to the server and start the MySQL cli and confirm the credentials are correct (login with them?) and have access to the jamfsoftware DB?

Seriously though I jump on the phone to Jamf support.

ctktech
New Contributor II

Yeah, I was afraid of that. I did reach out to my Jamf buddy yesterday morning, so I'm hoping to have him call me tomorrow morning ASAP. Thankfully, the database was backed up before the update took place, so at least the database will be recoverable.

When I login to the server and run the MySQL cli, I am prompted with a password, but unfortunately any password I use doesn't work. I get a "Access denied for user root@localhost" message on the cli (which I'm assuming means I typed in the wrong password).

PatrickD
Contributor II

:/ Sorry to hear. Do you have a test box that you can run up and install MySQL and restore one of your JSS DB backups to so you can login to that one and confirm that you do actually know the root password? Not that I'm doubting you but I know what these thing can be like especially if someone else was the one to build it initially.

Doesn't have to be anything special, you could even do it with a spare Mac if you have one lying around.

DI_Casper
New Contributor II

I've experienced this before, the issue for me was that the database.xml had the wrong permissions and keystore.jks was missing. I had to set the appropriate permissions and restore keystore.jks from the backup folder. This was on Linux though. I would check your database.xml to make sure it's right

rrouleau
Contributor

Bookmarking, as I saw the same issue on my Windows server when installing the latest JSS patch. My SQL database is on an external box.

I rolled back and everything is working again.

@ctktech Please post an update of the fix, if you would...

cbrewer
Valued Contributor II

I saw the same issue this weekend upgrading to 9.97.1488392992. The fix for me was uninstalling the JSS completely via Add/Remove Programs then installing the JSS from scratch. Of course, this required adding my SSL cert, resetting Tomcat memory settings, connection pool settings, etc. Not ideal.

scottb
Honored Contributor

This thread below...

JSS Upgrade gone bad...

ctktech
New Contributor II

So I found out that we had a previous snapshot in place back in July of 2016, so I reverted back to that snapshot (thank goodness for VMWare snapshots), and I upgraded to version 9.97.1482356336, and recovered the database to the most recent version (thankfully it was a snapshot before the botched upgrade). So I have recovered very well.

I would say the easiest option is to recover from a previous snapshot or backup if you are able to, otherwise it does look like you may have to reinstall the whole thing.

easyedc
Valued Contributor II

So I am now having the same issue as this but I have not performed any JSS upgrades. In my setup what is happening is that the server on my internal network is fine, but I'm getting the same error trying to let my DMZ server communicate with the internal DB. Everything was fine and then suddenly this? Didn't make any server changes, but network changes could have occurred but nothing I'm aware of.

endor-moon
Contributor II

I got the same error on my Linux JSS because I forgot to become root before issuing the command:

jamf-pro database backup

I was using JAMF Pro 10.15.1 and just upgraded to 10.16.1 this morning.