mysql8 and php7 cannot connect

王林
Release: 2023-02-26 22:00:01
Original
3811 people have browsed it

mysql8 and php7 cannot connect

mysql8 and php7 cannot connect

Solution:

sudo vim /etc/my.cnf
Copy after login

Add:

[mysqld] default_authentication_plugin=mysql_native_password
Copy after login

Create a new user after modifying the configuration and restarting. You can make its password the same as the root password for subsequent use (this step can also verify whether the configuration is effective. If it is effective, the encrypted string should be as follows root password is different)

Recommended tutorial:mysql tutorial

The above is the detailed content of mysql8 and php7 cannot connect. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!