Home > Backend Development > PHP Problem > Is MySQL8.0 version incompatible with PHP7?

Is MySQL8.0 version incompatible with PHP7?

Guanhui
Release: 2023-03-01 12:56:01
Original
4970 people have browsed it

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

Is MySQL8.0 version incompatible with PHP7?

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';
Copy after login

Then add a line in my.cnf:

default_authentication_plugin=mysql_native_password;
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template