xampp将数据从同一个网络中连接的不同系统发送到MySQL db到本地主机

时间:2018-10-10 11:41:44

标签: python mysql xampp

我正在尝试将数据从另一个连接到本地主机的系统发送到Xampp的MySQL数据库。

我已经在xampp.conf文件中授予了权限,但是我仍然面临着同样的问题。

下面是我面临的两个错误。

Traceback (most recent call last):
  File "test.py", line 7, in <module>
    db = MySQLdb.connect(host="192.168.0.142", user="safepro", passwd="Safepro@123", db="ers")
  File "/usr/lib/python3/dist-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 204, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1130, "Host 'SP004-PRECISION' is not allowed to connect to this MariaDB server")


Traceback (most recent call last):
  File "test.py", line 7, in <module>
    db = MySQLdb.connect(host="127.0.0.1", user="safepro", passwd="Safepro@123", db="ers")
  File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 204, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'safepro'@'localhost' (using password: YES)")

 Help me with the solution, where should I change the setting.

谢谢。

1 个答案:

答案 0 :(得分:0)

您需要允许来自其他主机的MySQL连接。

您可以使用solution from this question