Database connection issue when mySQL and Apache are on the same server

Hi, ive installed Dolibarr about 3 times, there appears to be some issue when the Apache server is on same as the SQL database… creating everything works, the moment the server is restarted, Dolibarr complains the password is wrong, so i change Dolibarr to use root, works again, then restart, then it doesn’t like the root password, even though it wasnt changed, i am using it with WorkBench, so what’s the issue here, why is PHP / Dolibarr deciding after a reboot to not like the username and password?

At this time i am now “locked” out the batabase with Dolibarr, however Workbench, the root username and password work fine, Dolibarr says its wrong (when its not).

Ive also seen “mySQL has gone away” sometimes as well, this appears to be some odd PHP issue, i just cant track down what it is…

UPDATE (fixed)
We had PHP v7.2.8, doing a bit of reading, the only version of PHP that supports SHA2 cache passwords is PHP v7.4, so we installed PHP v7.4.11 and it worked instantly (refresh the page and its in).

Have you solved this issue? If not try to connect to database over phpAdmin with your root name and password. Check in hotdogs/conf/conf.php your database details, port, username, password.