OperationalError: (OperationalError) (2003, “Can't connect to MySQL server on '192.168.129.139' (111)”) None None

后端 未结 1 1299
一整个雨季
一整个雨季 2020-12-05 20:48

I am trying to create a remote database using mysql on an Ubuntu machine running 12.04.

It has a root user with remote login enabled and no password.I have started t

相关标签:
1条回答
  • 2020-12-05 21:28

    Looks like mysql is configured to listen only on localhost.

    You can test this by running telnet 192.168.129.139 3306 from your client machine.

    Most probable reason - mysqld is configured to do so.

    Please try to follow Configuration step described here:

    Edit the /etc/mysql/my.cnf file to configure MySQL to listen for connections from network hosts, change the bind-address directive to the server's IP address. For example Replace 192.168.0.5 with the appropriate address. If there are no such entry - uncomment it or create new line.

    bind-address            = 192.168.0.5
    

    Then restart mysqld

    sudo service mysql restart
    

    Then test with telnet or by running your application once again. Also netstat would have second entry for mysqld.

    0 讨论(0)
提交回复
热议问题