0

I install mysql on centos7 server(server ip is 192.168.1.83)。 Now I use python script to connect mysql,but the python script went wrong

Snapshots:

enter image description here enter image description here

The host set in python script is 192.168.1.83,but it turn to 192.168.1.70 when I run the script.192.168.1.70 is my computer local IP.I search though google,but can't find any solution.

jo_va
  • 13,504
  • 3
  • 23
  • 47
张铭浩
  • 11
  • 1
  • Hi welcome to stackoverflow! Some users can't read images so please put type out any error messages. Also without including a MVCE (in particular the python script that connects to mysql), it will be difficult to help you. [mcve] – Bailey Parker Feb 28 '19 at 10:39

1 Answers1

0

The error message means that this user root which coming through this host 192.168.1.170 will not be able to connect to the database which you are trying to access at 192.168.1.83. What you need to do is to allow remote MySQL connection from the host 192.168.1.170 for this user root which will make the script able to work as expected.

Mostafa Hussein
  • 11,063
  • 3
  • 36
  • 61