mariaDB Fatal error: Uncaught PDOException: Packets out of order. Expected 0 received 1. Packet size=83
Fatal error: Uncaught PDOException: Packets out of order. Expected 0 received 1. Packet size=83 in /var/www/app/src/db.inc.php:28 Stack trace: #0 /var/www/app/src/db.inc.php(28): PDO->__construct() #1 /var/www/app/src/db.inc.php(38): getDB() #2 /var/www/app/src/routes.php(26): require_once('/var/www/thecan...') #3 /var/www/app/public_html/index.php(27): require('/var/www/thecad...') #4 {main} Next PDOException: SQLSTATE[HY000] [2006] MySQL server has gone away in /var/www/app/src/db.inc.php:28 Stack trace: #0 /var/www/app/src/db.inc.php(28): PDO->__construct() #1 /var/www/app/src/db.inc.php(38): getDB() #2 /var/www/app/src/routes.php(26): require_once('/var/www/thecad...') #3 /var/www/app/public_html/index.php(27): require('/var/www/thecad...') #4 {main} thrown in /var/www/app/src/db.inc.php on line 28
Why? Look into the error.log
2022-03-27 23:40:48 53 [Warning] Access denied for user 'thecadhosting'@'localhost' (using password: YES)
Solution
It's just a password failure. With a very bad error message percolating up.
Checkout the TABLE users
SELECT * FROM `user`
Verify that the three column for the user you are using are OK
Host
User
Password
If it's localhost, you can also add another line with the IP, or make sure there is no other line with the local IP that has a different password.
The User is the user used in the DB connection
If it still doesn't work, try the password with the CLI command. If it doesn't work reset the password.
You can also copy paste the Password column value from one row to another to use the same password.
Solution #2
There can be a firewall actively blocking the connection. Some popular firewalls are ufw and iptables
ufw
sudo ufw allow from <my-pc-ip> to any port 3306
The aboves opens only to one IP
iptables
sudo iptables -A INPUT -p tcp --destination-port 3306 -j ACCEPT
The aboves opens to all IP
Recent Comments