Forums / Installing on a Linux/Unix Server / 2.01 Uncaught PDOException: PDO::__construct(): Error while reading greeting packet

2.01 Uncaught PDOException: PDO::__construct(): Error while reading greeting packet

Views: 4,322

Results 1 to 7 of 7
21 May 2024, 12:51 PM
#1
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

2.01 Uncaught PDOException: PDO::__construct(): Error while reading greeting packet

On totally clean installation of either 1.5.8 or ZC 2.01, mysql becomes unstable and goes away with the error log below. Is this a PHP error ...

Zencart 1.5.8 and 2.01 clean installation, nothing added from the standard code, except the demo data. MySQL 5.7.31, PHP Version: 8.1.28 (Zend: 4.1.28),

MySQL Mode: ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

PHP Fatal error: Uncaught PDOException: PDO::__construct(): Error while reading greeting packet. PID=1886 in /laravel/vendor/illuminate/database/Connectors/Connector.php:70
Attachment 20620
Stack trace:
#0 /laravel/vendor/illuminate/database/Connectors/Connector.php(70): PDO->__construct()
#1 /laravel/vendor/illuminate/database/Connectors/Connector.php(100): Illuminate\Database\Connectors\Connector->createPdoConnection()
#2 /laravel/vendor/illuminate/database/Connectors/Connector.php(50): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection()
#3 /laravel/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
#4 /laravel/vendor/illuminate/database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors{closure}()
#6 /laravel/vendor/illuminate/database/Connection.php(1181): call_user_func()
#7 /laravel/vendor/illuminate/database/Connection.php(1217): Illuminate\Database\Connection->getPdo()
#8 /laravel/vendor/illuminate/database/Connection.php(486): Illuminate\Database\Connection->getReadPdo()
#9 /laravel/vendor/illuminate/database/Connection.php(414): Illuminate\Database\Connection->getPdoForSelect()
#10 /laravel/vendor/illuminate/database/Connection.php(753): Illuminate\Database\Connection->Illuminate\Database{closure}()
#11 /laravel/vendor/illuminate/database/Connection.php(899): Illuminate\Database\Connection->runQueryCallback()
#12 /laravel/vendor/illuminate/database/Connection.php(879): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection()
#13 /laravel/vendor/illuminate/database/Connection.php(723): Illuminate\Database\Connection->handleQueryException()
#14 /laravel/vendor/illuminate/database/Connection.php(422): Illuminate\Database\Connection->run()
#15 /laravel/vendor/illuminate/database/Query/Builder.php(2706): Illuminate\Database\Connection->select()
#16 /laravel/vendor/illuminate/database/Query/Builder.php(2694): Illuminate\Database\Query\Builder->runSelect()
#17 /laravel/vendor/illuminate/database/Query/Builder.php(3230): Illuminate\Database\Query\Builder->Illuminate\Database\Query{closure}()
#18 /laravel/vendor/illuminate/database/Query/Builder.php(2695): Illuminate\Database\Query\Builder->onceWithColumns()
#19 /laravel/vendor/illuminate/database/Eloquent/Builder.php(710): Illuminate\Database\Query\Builder->get()
#20 /laravel/vendor/illuminate/database/Eloquent/Builder.php(694): Illuminate\Database\Eloquent\Builder->getModels()
#21 /includes/classes/PluginManager.php(31): Illuminate\Database\Eloquent\Builder->get()
#22 /MacAdmin!/includes/application_bootstrap.php(174): Zencart\PluginManager\PluginManager->getInstalledPlugins()
#23 /MacAdmin!/index.php(10): require_once('...')
#24 {main}

Next PDOException: SQLSTATE[HY000] [2006] MySQL server has gone away in /laravel/vendor/illuminate/database/Connectors/Connector.php:70

Attachment 20621
Attachment 20622

21 May 2024, 2:44 PM
#2
billj avatar

billj

New Zenner

Join Date:
Sep 2013
Location:
Devon, UK
Posts:
88
Plugin Contributions:
1

Re: 2.01 Uncaught PDOException: PDO::__construct(): Error while reading greeting packet

Georgecy:

Next PDOException: SQLSTATE[HY000] [2006] MySQL server has gone away in /laravel/vendor/illuminate/database/Connectors/Connector.php:70
That looks to me as though either the MySQL server itself or the connection from the web server to the MySQL server has hit a problem. The PHP errors would happen if the database server stopped responding. I don't think the cause of the problem is anything to do with PHP code on the web server.

21 May 2024, 8:20 PM
#3
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Re: 2.01 Uncaught PDOException: PDO::__construct(): Error while reading greeting packet

Zen Cart v1.5.8 requires MySQL 5.7.8+ or MariaDB 10.2.7+

2 + 2 = 5 for extremely large values of 2

Pez Collectors Store •••••••• My Plugins List

21 May 2024, 9:38 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: 2.01 Uncaught PDOException: PDO::__construct(): Error while reading greeting packet

gothstone:

Zen Cart v1.5.8 requires MySQL 5.7.8+ or MariaDB 10.2.7+

MySql 5.7.31 > MySql 5.7.8.

Based on BillJ's assessment, I could see file on questions about hosting. Dedicated server? Shared hosting? Local setup?

Doing a search on the primary message, "Uncaught PDOException: PDO::__construct(): Error while reading greeting packet. " suggested that the server name for the MySql server may be a cause based on server configuration. E.g. if using a domain name for the server, may need to use localhost or the same with a port number.

In absence of additional (posting tips related) infotainment, would suggest contacting your host to trouble shoot.

Next question would be related to past history of running perhaps an earlier version on the same server, did it used to work, but now the newer version doesn't? All sorts of ways to look at the issue depending on additional information.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

22 May 2024, 9:17 AM
#5
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: 2.01 Uncaught PDOException: PDO::__construct(): Error while reading greeting packet

mc12345678:

MySql 5.7.31 > MySql 5.7.8.

Based on BillJ's assessment, I could see file on questions about hosting. Dedicated server? Shared hosting? Local setup?

Doing a search on the primary message, "Uncaught PDOException: PDO::__construct(): Error while reading greeting packet. " suggested that the server name for the MySql server may be a cause based on server configuration. E.g. if using a domain name for the server, may need to use localhost or the same with a port number.

In absence of additional (posting tips related) infotainment, would suggest contacting your host to trouble shoot.

Next question would be related to past history of running perhaps an earlier version on the same server, did it used to work, but now the newer version doesn't? All sorts of ways to look at the issue depending on additional information.

Thank for the comments. The server is dedicated in house and is the same version for a couple years and it runs ZC1.5.7d with PHP 7.4 without any issue. If PHP is changed from 8.1.28 to 8.0.10 for ZC2.01 then it runs more stable.

I am not sure if the Laravel mechanism may cause a problem. Is it a way to bypass the Laravel mechanism and use the previous one that supported only Mysql?
In mysql localhost is always used.
The ZC158a installation was removed just in case and I will continue with the 2.01.
I will install the Bootstrap Template and see the effects.
I am not upgrading the database yet as to avoid any new issues.

I will let you know if the issue is resolved

Thanks guys

13 Sep 2024, 1:44 PM
#6
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: 2.01 Uncaught PDOException: PDO::__construct(): Error while reading greeting packet

Hi Guys,
Unfortunately I was not able to find a solution for the problem below. If anybody encountered this problem and found a solution please post it here.

Thanks,
George

Georgecy:

On totally clean installation of either 1.5.8 or ZC 2.01, mysql becomes unstable and goes away with the error log below. Is this a PHP error ...

Zencart 1.5.8 and 2.01 clean installation, nothing added from the standard code, except the demo data. MySQL 5.7.31, PHP Version: 8.1.28 (Zend: 4.1.28),

MySQL Mode: ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

PHP Fatal error: Uncaught PDOException: PDO::__construct(): Error while reading greeting packet. PID=1886 in /laravel/vendor/illuminate/database/Connectors/Connector.php:70
Attachment 20620
Stack trace:
#0 /laravel/vendor/illuminate/database/Connectors/Connector.php(70): PDO->__construct()
#1 /laravel/vendor/illuminate/database/Connectors/Connector.php(100): Illuminate\Database\Connectors\Connector->createPdoConnection()
#2 /laravel/vendor/illuminate/database/Connectors/Connector.php(50): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection()
#3 /laravel/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
#4 /laravel/vendor/illuminate/database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors{closure}()
#6 /laravel/vendor/illuminate/database/Connection.php(1181): call_user_func()
#7 /laravel/vendor/illuminate/database/Connection.php(1217): Illuminate\Database\Connection->getPdo()
#8 /laravel/vendor/illuminate/database/Connection.php(486): Illuminate\Database\Connection->getReadPdo()
#9 /laravel/vendor/illuminate/database/Connection.php(414): Illuminate\Database\Connection->getPdoForSelect()
#10 /laravel/vendor/illuminate/database/Connection.php(753): Illuminate\Database\Connection->Illuminate\Database{closure}()
#11 /laravel/vendor/illuminate/database/Connection.php(899): Illuminate\Database\Connection->runQueryCallback()
#12 /laravel/vendor/illuminate/database/Connection.php(879): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection()
#13 /laravel/vendor/illuminate/database/Connection.php(723): Illuminate\Database\Connection->handleQueryException()
#14 /laravel/vendor/illuminate/database/Connection.php(422): Illuminate\Database\Connection->run()
#15 /laravel/vendor/illuminate/database/Query/Builder.php(2706): Illuminate\Database\Connection->select()
#16 /laravel/vendor/illuminate/database/Query/Builder.php(2694): Illuminate\Database\Query\Builder->runSelect()
#17 /laravel/vendor/illuminate/database/Query/Builder.php(3230): Illuminate\Database\Query\Builder->Illuminate\Database\Query{closure}()
#18 /laravel/vendor/illuminate/database/Query/Builder.php(2695): Illuminate\Database\Query\Builder->onceWithColumns()
#19 /laravel/vendor/illuminate/database/Eloquent/Builder.php(710): Illuminate\Database\Query\Builder->get()
#20 /laravel/vendor/illuminate/database/Eloquent/Builder.php(694): Illuminate\Database\Eloquent\Builder->getModels()
#21 /includes/classes/PluginManager.php(31): Illuminate\Database\Eloquent\Builder->get()
#22 /MacAdmin!/includes/application_bootstrap.php(174): Zencart\PluginManager\PluginManager->getInstalledPlugins()
#23 /MacAdmin!/index.php(10): require_once('...')
#24 {main}

Next PDOException: SQLSTATE[HY000] [2006] MySQL server has gone away in /laravel/vendor/illuminate/database/Connectors/Connector.php:70

Attachment 20621
Attachment 20622

13 Sep 2024, 4:28 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: 2.01 Uncaught PDOException: PDO::__construct(): Error while reading greeting packet

You'll need to check with your webhost. They might have been doing some kind of server maintenance at the time of that log. Essentially, the Zen Cart code couldn't connect to the MySQL server.