如何修复 (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)") on ec2 bitnami? [英] how to fix (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)") on ec2 bitnami?

查看:66
本文介绍了如何修复 (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)") on ec2 bitnami?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 AWS 上使用 python django 开发 ec2 bitnami.我在从 mysql 数据库中获取对象时遇到 (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)").

I am working on ec2 bitnami with python django on AWS. I am encountering (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)") while fetching objects from mysql database.

我已经浏览了很多论坛,但我仍然不明白它到底是什么以及为什么会出现这个问题.请告诉我它是什么以及如何在 ec2 bitnami 上为 python django mysql 修复它.

I have been gone through so many forums still I am not getting what is it exactly and why this problem being arisen. Please tell me what is it and how to fix it for python django mysql on ec2 bitnami.

提前致谢.

推荐答案

HOST 设置为

127.0.0.1

settings.py 中并确保 MySQL 服务器正在运行.

in settings.py and make sure MySQL server is running.

这篇关于如何修复 (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)") on ec2 bitnami?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆