Backups not working - unable to connect to database

barber
New Contributor

Took the plunge yesterday and upgraded the server to Mavericks and JSS 8.73. Everything is working except that the backups didn't run last night. I've launched jssDatabaseUtil but it seems it can't verify the database and i get the following error message

Unable to connect to the database: ERROR 1045 (28000) Access Denied for user 'jamfsoftware@localhost' using password: YES). Please make sure that MySQL is running and that a firewall is not blocking the JSS Database Utility.

Java is up to date, rebuilt permissions disabled AV and btw no firewalls in place.

Bizarrely when i launch the Database Connection Setup it types 1 character every 30 seconds. Somethings not right. Any help appreciated.

M

13 REPLIES 13

colonelpanic
Contributor

What version of MySQL are you running?

barber
New Contributor

MySQL Server 5.5

barber
New Contributor

MySQL Server 5.5

rtrouton
Valued Contributor III

@barber][/url, are you using the default password for your JSS database? One way to check what your password is by running the following command in Terminal:

mysql -u jamfsoftware -p

You should then receive the following:

Enter password:

From there, put in the password that you think it should be. If it works, you should get output like this:

Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is number_here
Server version: server_version_here

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>

If the password you have is incorrect, you should receive something like the following:

mysql -u jamfsoftware -p
Enter password:
ERROR 1045 (28000): Access denied for user 'jamfsoftware'@'localhost' (using password: YES)

If your password is correct, what worked for me after my MySQL 5.1 -> 5.5 upgrade was to go into JSS Database Utility's password settings for MySQL and set the database password line to be blank.

Once the password is set to be blank, save your change and quit out of the JSS Database Utility.

If you're using the default password for your JSS database, re-open the JSS Database Utility and then run a manual backup. It should succeed because blanking the password seemingly resets the JSS Database Utility to use the default password.

If you're not using the default password, re-open the JSS Database Utility and go back in the password settings for MySQL. From there, set your database's password and then run a manual backup. It should succeed.

Once the manual backup succeeds, re-setup your database backup schedule. It should run correctly after that.

If the password is rejected, or if the manual backup doesn't succeed, I recommend calling JAMF support.

barber
New Contributor

Had to contact JAMF - thanks

aurica
New Contributor III

I had a similar issue with a RHEL VM in one of our test environments. It turned out to be caused by a JSSDBUtilityConfig.xml file that was duplicated from another VM. Any attempts to schedule a backup, backup manually, or 'unschedule' with the JSS Database Utility failed with the same error:

Error: Unable to connect to the database.
Database Connection Information:
 Server: 127.0.0.1
 Port: 3306
 Database: *databasename*
 Username: *databaseuser*
 Password: ********
Error: Please verify and set your database connection information.

As in @rtrouton's example, I could log in to confirm that my database user was configured correctly. DataBase.xml had the correct password, too.

So, when I discovered that the JSSDBUtilityConfig.xml contained a <DataBasePassword>...</DataBasePassword>, I renamed the file and, lo, I was able to schedule backups once more... ```
sudo java -jar /usr/local/jss/bin/JSSDatabaseUtil.jar schedule <schedule parameters>
```

descovich_l
New Contributor

Post from Aurica worked for me. Thanks for the post.

gnsadmin
New Contributor II

Post from Aurica worked for me: ubuntu 14.04lts JSS 9.92
Thank you.

Fresh_Prince
New Contributor

Post from Aurica worked for me also: Windows Server 2012R2 JSS 9.99.0

sisipad17
New Contributor

thank u aurica ,it worked

wsalev
New Contributor

Huge help Aurica! Thank you!

blacktip
New Contributor II

Aurica, your post was very helpful.

For anyone on Ubuntu, the path to the XML file is /usr/local/jss/bin/JSSDBUtilityConfig.xml.

cd /usr/local/jss/bin/
mv JSSDBUtilityConfig.xml JSSDBUtilityConfig.xml.old
sudo java -jar /usr/local/jss/bin/JSSDatabaseUtil.jar schedule <schedule parameters>

Kudos to Aurica!

andrewtadkins5
New Contributor II

Cheers, Aurica. Four years later and up to v10.5.0, renaming the .xml works to resolve that error.