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:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password
BY '...';
But in this query it gave me a syntax error and for that I used the one that was successful:
ALTER USER 'root'@'localhost' IDENTIFIED BY '...';
But the problem still exists. I also want to insert the fact that there are 2 connection strings in my project. There is no problem with one, but with the PDO connection string I get this error from the try catch construction:
Connection failed: SQLSTATE [HY000] [2054] The server requested authentication method unknown to the client
I read that the problem may be due to busy ports, but I decided to consult you before I started messing with the XAMPP files. Basically I changed the port to 3308 and the workbench is to 3306 but still when I run XAMPP I get an error message:
Problem detected!
Port 3306 in use by "Unable to open process"!
MySQL WILL NOT start without the configured ports free!
You need to uninstall / disable / reconfigure the blocking application
or reconfigure MySQL and the Control Panel to listen on a different port
However, I still managed to start MySQL.
I decided to write this to get advice and possibly help people with the same problem, because I saw that there are a lot of people who have encountered this.