Home > Article > Backend Development > Is MySQL8.0 version incompatible with PHP7?
Incompatibility between MySQL8.0 version and PHP7?
MySQL8.0 version is incompatible with PHP7. There are generally two situations:
1. Mainly because MySQL8.0 defaults to utfmb4 format, and PHP defaults to UTF8 format;
Solution: You need to set the default format of MySQL8.0 to UTF8
2. Caused by incompatible encryption methods for identity authentication, the default format in MySQL8.0 The method is caching_sha2_password.
Solution:
Just create a new user with the old encryption method and initialize the password:
CREATEUSERusername@localhostidentifiedwithmysql_native_passwordby'password';
Then add a line in my.cnf:
default_authentication_plugin=mysql_native_password;
Recommended tutorial: "PHP Tutorial"
The above is the detailed content of Is MySQL8.0 version incompatible with PHP7?. For more information, please follow other related articles on the PHP Chinese website!