Upgrade wizard failing on SuiteCRM 7.10.5 getting DB error

My environment is
PHP Version 7.0.32-0
Ubuntu 16.04.1 and
SuiteCRM 7.10.5

When doing upgrade via Admin-> Upgrade Wizard, it fails on the system check step showing errors in the upgradeWizard.log as

Thu, 20 Sep 2018 13:32:42 -0400 [UpgradeWizard] - Upgrade started. At start.php
Thu, 20 Sep 2018 13:32:42 -0400 [UpgradeWizard] - at unlinkUWTempFiles()
Thu, 20 Sep 2018 13:32:42 -0400 [UpgradeWizard] - finished!
Thu, 20 Sep 2018 13:32:42 -0400 [UpgradeWizard] - resetting $_SESSION
Thu, 20 Sep 2018 13:32:45 -0400 [UpgradeWizard] - setting session variables...
Thu, 20 Sep 2018 13:32:45 -0400 [UpgradeWizard] - [At systemCheck.php]
Thu, 20 Sep 2018 13:32:45 -0400 [UpgradeWizard] - Starting file permission check...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Finished file permission check.
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Starting database permissions check...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Checking CREATE TABLE permissions...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - cannot CREATE TABLE!
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Checking INSERT INTO permissions...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - cannot INSERT INTO!
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Checking UPDATE TABLE permissions...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - cannot UPDATE TABLE!
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Checking SELECT permissions...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - cannot SELECT!
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Checking DELETE FROM permissions...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - cannot DELETE FROM!
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Checking ALTER TABLE ADD COLUMN permissions...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - cannot ADD COLUMN!
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Checking ALTER TABLE CHANGE COLUMN permissions...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - cannot CHANGE COLUMN!
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Checking ALTER TABLE DROP COLUMN permissions...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - cannot DROP COLUMN!
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Checking DROP TABLE permissions...
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - cannot DROP TABLE!
Thu, 20 Sep 2018 13:33:00 -0400 [UpgradeWizard] - Finished database permissions check.

The Suitecrm.log shows following error log


Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: CREATE TABLE temp (id varchar(36)): MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Checking privileges: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: INSERT INTO temp (id) VALUES ('abcdef0123456789abcdef0123456789abcd'): MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Checking privileges: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: UPDATE temp SET id = '100000000000000000000000000000000000' WHERE id = 'abcdef0123456789abcdef0123456789abcd': MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Checking privileges: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: SELECT id FROM temp WHERE id='100000000000000000000000000000000000' LIMIT 0,1: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Get One Failed:SELECT id FROM temp WHERE id='100000000000000000000000000000000000': MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: DELETE FROM temp WHERE id = '100000000000000000000000000000000000': MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Checking privileges: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: ALTER TABLE temp add COLUMN test varchar(50)  NULL : MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Checking privileges: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: ALTER TABLE temp modify COLUMN test varchar(100)  NULL : MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Checking privileges: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: ALTER TABLE temp drop COLUMN test: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Checking privileges: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: DROP TABLE IF EXISTS temp: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Checking privileges: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: SELECT version() version LIMIT 0,1: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Get One Failed:SELECT version() version: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL]  Query Failed: SELECT id FROM upgrade_history ORDER BY date_entered desc: MySQL error 2006: MySQL server has gone away
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Exception handling in /home/admin/web/cmasoc.louisfinancial.com/public_html/include/MVC/Controller/SugarController.php:402
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.
Thu Sep 20 13:33:00 2018 [13038][1][FATAL] backtrace:
#0 /home/admin/web/cmasoc.louisfinancial.com/public_html/include/database/DBManager.php(353): sugar_die('Database failur...')
#1 /home/admin/web/cmasoc.louisfinancial.com/public_html/include/database/DBManager.php(328): DBManager->registerError(' Query Failed: ...', ' Query Failed: ...', true)
#2 /home/admin/web/cmasoc.louisfinancial.com/public_html/include/database/MysqliManager.php(177): DBManager->checkError(' Query Failed: ...', true)
#3 /home/admin/web/cmasoc.louisfinancial.com/public_html/data/SugarBean.php(5519): MysqliManager->query('SELECT id FROM ...', true)
#4 /home/admin/web/cmasoc.louisfinancial.com/public_html/modules/Administration/UpgradeHistory.php(171): SugarBean->build_related_list('SELECT id FROM ...', Object(UpgradeHistory))
#5 /home/admin/web/cmasoc.louisfinancial.com/public_html/modules/Administration/UpgradeHistory.php(167): UpgradeHistory->getList('SELECT id FROM ...')
#6 /home/admin/web/cmasoc.louisfinancial.com/public_html/modules/UpgradeWizard/index.php(312): UpgradeHistory->getAll()
#7 /home/admin/web/cmasoc.louisfinancial.com/public_html/include/MVC/View/SugarView.php(840): include_once('/home/admin/web...')
#8 /home/admin/web/cmasoc.louisfinancial.com/public_html/include/MVC/View/views/view.classic.php(74): SugarView->includeClassicFile('/home/admin/web...')
#9 /home/admin/web/cmasoc.louisfinancial.com/public_html/include/MVC/View/SugarView.php(207): ViewClassic->display()
#10 /home/admin/web/cmasoc.louisfinancial.com/public_html/include/MVC/Controller/SugarController.php(432): SugarView->process()
#11 /home/admin/web/cmasoc.louisfinancial.com/public_html/include/MVC/Controller/SugarController.php(375): SugarController->processView()
#12 /home/admin/web/cmasoc.louisfinancial.com/public_html/include/MVC/SugarApplication.php(109): SugarController->execute()
#13 /home/admin/web/cmasoc.louisfinancial.com/public_html/index.php(52): SugarApplication->execute()
#14 {main}
Thu Sep 20 13:33:00 2018 [13041][-none-][FATAL] Mysqli_query failed.
Thu Sep 20 13:33:00 2018 [13041][-none-][FATAL] Retrieving record by id users:1 found  Query Failed: SELECT users.* FROM users  WHERE users.id = '1' AND users.deleted=0 LIMIT 0,1: MySQL error 2006: MySQL server has gone away

I am able to perform operations on Modules, Create/Edit/Update records and send emails on the instance using the same DB credentials. i also tried the Root user details in config.php for DB but same error. Is this something related to SuiteCRM or this is more of MySQL service related issue. How to narrow down on this to fix it. I even removed config.php file and Ran the Installation on a new DB but the upgrade wizard still failed.

Any clues on this would be appreciated. Thanks in advance.

I am also facing same error in Upgrade Wizard.

Please suggest some solution asap.

Thanks,