Connection failed: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client. Busy ports or source code problem?

I decided to continue an old project that I had abandoned some time ago due to many mistakes. With new strength I started to remove mistakes but I reached a point where I got stuck. I found with great difficulty that my problem came from the PDO connection to my database and half of my code became unusable. I read on the topic and tried many different ways to solve the problem, but without success. For starters I will say that I use XAMPP, Server version: 10.4.8-MariaDB, Apache / 2.4.41 (Win64) OpenSSL / 1.1.1c PHP / 7.3.1, phpMyAdmin Version information: 5.1.1 (up to date). Since I haven’t used XAMPP for a long time and I have Workbench, Postgree and others installed, I had to change the ports of Apache and MySQL. I put a password on the root account in phpMyAdmin because I read that this can help, but then there were more problems, I used this request in phpMyAdmin:

Xampp shows MySQL shutdown unexpectedly; isn’t working unless every time of reinstalling xampp,

My Xampp server is showing “MySQL shutdown unexpectedly”. I did follow some solution to this problem but still it doesn’t fix. All I have to do is every time I have to use MYSQL I uninstall and reinstall Xampp and thus it works. But need a proper demonstration and solve for the problem I am facing. It’s tedious to reinstall every time.