Skip to content
Advertisement

MySQL8 connection with php7.3 and Symfony 5 does not work

I have a connection problem with a mysql8 database, php7.3 and Symfony 5. The user and the password are correct !

The connection to MySQL8 database must be done from an SSH tunnel

The SSH tunnel is working :

JavaScript

MySQL access configuration:

JavaScript

Doctrine configuration :

JavaScript

I have the same problem with heidiSQL and on the VM

I tried with the Ip of the VM instead of 127.0.0.1

JavaScript

Doctrine configuration

JavaScript

However, this setting works with heidiSQL but not with the Symfony application !

Did I forget a setting on the VM or Mysql ?

Advertisement

Answer

127.0.0.1 connection issue : We have created the ‘[user]’@’127.0.0.1’ rights. In MySQL, 127.0.0.1 uses the network and localhost uses the socket.

The message “The server requested authentication method unknown to the client [caching_sha2_password]” was caused because the setting ‘default-authentication-plugin=mysql_native_password’ was created after the creation of the rights. We regenerated the rights, and now everything is working fine.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement