How do I use the skip-name-resolve option when using MySQLdb for Python?

I try to connect to database in a domain from my virtual machine. It works on XP, but somehow does not work on Win7 and quitting with: “OperationalError: (1042, “Can’t get hostname for your address”)”

Now I tried disable Firewall and stuff, but that doesn’t matter anyway. I don’t need the DNS resolving, which will only slow everything down. So I want to use the option “skip-name-resolve”, but there is no my.ini or my.cnf when using MySQLdb for Python, so how can I still use this option?

Thanks for your help -Alex

Add the following line(skip-name-resolve) in the /etc/mysql/my.cnf file

[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
skip-name-resolve

And restart the mysql server

Hello, buddy!责编内容来自:Hello, buddy! (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 综合编程 » How do I use the skip-name-resolve option when using MySQLdb for Python?

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录