我正在尝试将数据从另一个连接到本地主机的系统发送到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.
谢谢。