Error trying to import JSS Mac 8.73 DB to JSS Win 9.5x MySQL

ZZT231
New Contributor

Hello All,

I'm new as a JSS Casper admin and having issues in trying to import my current Mac MySQL JSS DB to my Windows JSS. I've searched online and in the KB and can't find anything that could assist me.

When importing the backed up database from last night from the Mac onto Windows I get this error:

Warning: Using a password on the command line interface can be insecure.ERROR 2006 (HY000) at line 2363: MySQL server has gone away

In the JSS Database Utility under Utilities - Restart MySQL & Change MySQL Settings are grayed out.

The server is running Windows 2008r2, MySQL 5.6 Enterprise and JSS 9.51.

Has anyone had this error and can share their wisdom in solving this?

1 ACCEPTED SOLUTION

DavidSu
New Contributor III
New Contributor III

Hey @ZZT231

The "MySQL server has gone away" error usually means the the max_allowed_packet variable in MySQL is not set large enough to do the restore. If you're not able to modify that variable with the DB Util, you could manually change it in the my.ini (Default path for it should be something like C:ProgramDataMySQLMySQL Server 5.6my.ini), and then restart the MySQL service using the Service Manager in Windows.

I usually like to set the max packet to the max value to ensure the restore succeeds, then drop it back down after I'm done. To do that, you'll be looking for a line in the my.ini that would be something like:
max_allowed_packet = ??
and we'll change that to:
max_allowed_packet = 1G

Once the change is made in the my.ini, MySQL will need to be restarted for it to take effect.

As for why you aren't able to do that from the DB Util, you may want to try running it as the local administrator, if you're not already.

Hope that helps!

View solution in original post

4 REPLIES 4

tomt
Valued Contributor

When I was testing v9 I ran into similar errors when trying to import a v8 backup file into v9 on a new server. What ended up working for me was to upgrade the v8 instance in place and then move the v9 backup to the new server.

Do you have another Mac that you can set up as a dev JSS temporarily?

ZZT231
New Contributor

Thanks tomt for the reply. Sadly I tried that and came up with the same error. I upgrade a clone copy of the current production environment from 8.73 to 9.5 on the Mac then moved it across to PC... Still came up with the same error...

I do have a test environment which is a good thing as I don't want to mess up production :(

DavidSu
New Contributor III
New Contributor III

Hey @ZZT231

The "MySQL server has gone away" error usually means the the max_allowed_packet variable in MySQL is not set large enough to do the restore. If you're not able to modify that variable with the DB Util, you could manually change it in the my.ini (Default path for it should be something like C:ProgramDataMySQLMySQL Server 5.6my.ini), and then restart the MySQL service using the Service Manager in Windows.

I usually like to set the max packet to the max value to ensure the restore succeeds, then drop it back down after I'm done. To do that, you'll be looking for a line in the my.ini that would be something like:
max_allowed_packet = ??
and we'll change that to:
max_allowed_packet = 1G

Once the change is made in the my.ini, MySQL will need to be restarted for it to take effect.

As for why you aren't able to do that from the DB Util, you may want to try running it as the local administrator, if you're not already.

Hope that helps!

ZZT231
New Contributor

Many thanks David for the suggestion, I have been consulting with JAMF support yesterday and this morning because of the previous error but it was related and was able to identify the problem and you hit the nail on the head... I modified the my.ini config file and up the size of max_allowed_packet=4M to 512M and it worked a treat!

I couldn't adjust it in the DB Utility for some reason as it was greyed out and couldn't and couldn't figure out where to change the value originally.

Cheers.