Error restoring back up database

Contributor III

I'm trying to set up a mac mini with 8.6 on it for testing so I grabbed a backup from our main server and tried to do a restore on it. Using the 8.6 database utility I start the restore and it takes about 10 minutes and then gets the following error:

"Encountered an error during database restore: Warning: Using a password on the command line interface can be insecure"

If I click OK on that message the restore stops. Look at the database it seems like most of the things are there - but not all. So I can't really use it for testing.

I then looked on here and found a command line method of doing a restore but everytime I would run it the following error showed up:
JSS Database Utility 8.6
Error: null

So I'm wondering what else I can try? We got users upgrading to 10.8 and I would like to update our system to be able to handle them - but I want to make sure I have a good database backup before doing so.


New Contributor

We seem to be having a slightly different problem. We had some stability issues on 8.43 and decided to upgrade to 10.6 and also upgrade the OS at the same time. So we took a backup, rebuilt the entire server from scratch, then installed 8.6 on it. When we try to restore the backup we get a different error:

ERROR 2006 (HY000) at line 9379: MySQL server has gone away.

Our thoughts are that because the backup is 8.43 that we need to rebuild Casper in 8.43, restore the backup, then upgrade it to 8.6.

Honored Contributor

AFAIK, that wouldn't be needed as Casper now has checks built-in (late 7.x??) to check schema version and automatically update it when MySQL starts. But, I could be wrong.

New Contributor

I was having the same issue but then I moved the backup file to ...../jss/backups/database/ and re-ran the command and it worked.

Valued Contributor

Did anyone have a fix for:
"Encountered an error during database restore: Warning: Using a password on the command line interface can be insecure"
I'm seeing it at the moment. Surely the database location doesn't matter, although I've moved the file to this location and am waiting at the moment to see what happens.

New Contributor III

I am also running into this issue. Moving the database to the backup/database directory doesn't seem to be helping either.


I've just upgraded from Lion to Mountain Lion, and changed the MySQL version from 5.5.20 to 5.6.10 and couldn't start the database server.

Then I deleted everything and installed Casper from the scratch, with MySQL 5.5.28, configured Casper and it was running with a blank database. I tried to restore the backup from a file which is in the backup/database folder and after an hour or so, I got the error that the MySQL server has gone away.

Could someone help me with this as soon as possible? I need to recover that backup. I don't mind if I have to install the whole server, but I need to recover the data from the backup.

Can it be an issue with Mountain Lion? Or maybe with the MySQL server version? I'm running Casper 8.62 by the way.


New Contributor III

I am in the process of building another JSS on Mountain Lion. The OS is 10.8.3, I just downloaded and installed the latest from the App Store. I installed MySQL Community Server 5.5 per Jamf KB article "Installing Java and MySQL". I have installed the Apple JavaforOSX2013-002.pkg (1.6.0_43). Then I installed the JSS version 8.52. Once I got through the JSS setup, I performed a backup of the basically empty database as a litmus marker. I had copied 2 backups from our production server, 1 automatic and 1 manual, to the new server. Tried a restoration with each and in the middle of each restoration got an "ERROR 2006 (HY000) at line 2663: MySQL server has gone away".

Each time I did this, I found most of the inventory and buildings restored, but the policies weren't there. Not sure what else was or wasn't restored, but a partial doesn't cut it. Then each time I was able to restore the empty database. So it seems the restoration mechanism is working but runs into a problem in the database or trying to process something from the database.

I have adjusted my Tomcat settings to a minimum RAM of 1056MB, maximum RAM of 6144MB, Min PermGen 192MB, and Max PermGen 384MB.
MySQL max packet size is set to 1024MB, Max Database connections 151.
There doesn't seem to be a clear answer as to what ERROR 2006 indicates. For some changing MySQL packet size seems to work, for others changing some delay in processing works, but many seem to be left scratching their heads.

Does anyone have a clear definition as to what the error means, how it applies here, and what can I do to fix the problem?

Contributor II

Bump for visibility. I am now experiencing this issue.

Contributor II

I believe I figured out the "Encountered an error during database restore: Warning: Using a password on the command line interface can be insecure" issue, at least in my case. I'm pretty sure the newer versions of MySQL output "Warning: Using a password on the command line interface can be insecure" as a benign reminder and still complete the task successfully. The JSS Database Utility must see that output and assume it is an error. I got that error 3 times before just logging into the JSS and checking everything out. Everything seems to be in order after ignoring that message.

New Contributor III
New Contributor III

In MySQL 5.6 Strict Mode is enabled by default. We can disable strict mode by following this KB.

bajones, you are correct that even through the error is thrown when restoring from a backup. If you log into the JSS, we would expect everything to look as it should.

Hope this helps!

Contributor II

it was the "MySQL server has gone away" error for me... changing the Max Packet Size from 1M to 16M did the trick. NOte this was on mountain lion server with no pre-installed MySQL environment. As a result there's no my.cnf file in /etc/, so I had to copy one from the /usr/local/mysql/support-files/ folder, then manually change this setting using nano. Until you create a my.cnf, the JSS DB Utility won't show an option to change MySQL settings.

New Contributor

I was getting the same "server has gone away" error and changing the Max Packet Size from 1M to 16M worked for me.

Release Candidate Programs Tester

Stumbled over this myself, just blogged it & linked back here

Esteemed Contributor III

@bentoms Wow this was just the ticket for the error we're seeing for the first time. :)


Release Candidate Programs Tester

No worries @donmontalvo


I recently encountered the "Error: null" message when trying to use JSSDatabaseUtiltiy to restore DB under Ubuntu.

The answer was quite easy actually - had to use full path to the .gz archive. Relative path did not work.


Thanks, @jcompton, full path did the trick for me as well, on macOS Sierra.

New Contributor II

@jcompton +1 fixed it for me!