Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据库链接失败: SQLSTATE[HY000] [2002] Connection refused #6

Open
v4if opened this issue Nov 6, 2016 · 1 comment
Open

数据库链接失败: SQLSTATE[HY000] [2002] Connection refused #6

v4if opened this issue Nov 6, 2016 · 1 comment

Comments

@v4if
Copy link

v4if commented Nov 6, 2016

使用DB.php连接数据库的时候报错

数据库链接失败: SQLSTATE[HY000] [2002] Connection refused

@v4if
Copy link
Author

v4if commented Nov 7, 2016

new PDO的那句代码改为
new PDO("mysql:host=".$serverName.";dbname=".$databaseName.";port=".$serverPort, $username, $password);
指定port,不是原来默认的3306端口了,就可以成功访问了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant