mysql访问失败
请教一个问题,我的linux安装了nginx和mysql,然后发布在上面的项目无法访问mysql
【报错:中文提示 : 连接数据库过程中发生错误,检查服务器是否正常连接字符串是否正确,实在找不到原因请先Google错误信息:Authentication to host 'localhost' for user 'Shop2022' using method 'mysql_native_password' failed with message: Access denied for user 'Shop2022'@'localhost' (using password: YES).
Chinese Message : Connection open error . Authentication to host 'localhost' for user 'Shop2022' using method 'mysql_native_password' failed with message: Access denied for user 'Shop2022'@'localhost' (using password: YES)】,但是项目在本地就能访问mysql是什么原因呢?
2 个回答
我理解的是你的程序和数据库部署在不同物理机上是么?
如果是这样的话,根据报错信息可以做如下检查:
1.账号密码是否配置正确
2.防火墙,比如阿里云的服务器是有防火墙的,看看是否对外暴漏了端口