I also encountered similar problems when I used Xiaoniao Cloud Server to build a website and database. I remember that I logged in to phpmyadmin, changed the "host" in the "user" table in the "mysql" database, and changed the "from" Rename "localhost" to "%" and it will be fine after restarting. If this method cannot solve the problem, you can take a look at this document: https://www.niaoyun.com/docs/16747.html/?utm_source=phpl-220110
1. First run mysql.exe through the command line to check whether it is connected. 2. When connecting through php, check whether the parameters of the pdo connection are written correctly
I also encountered similar problems when I used Xiaoniao Cloud Server to build a website and database. I remember that I logged in to phpmyadmin, changed the "host" in the "user" table in the "mysql" database, and changed the "from" Rename "localhost" to "%" and it will be fine after restarting. If this method cannot solve the problem, you can take a look at this document: https://www.niaoyun.com/docs/16747.html/?utm_source=phpl-220110
1. First run mysql.exe through the command line to check whether it is connected. 2. When connecting through php, check whether the parameters of the pdo connection are written correctly