0

I can connect to MySQL database that is running on the server computer using localhost with this

connectionstring = "Host=localhost; database=dbname; user=dbuser; password=dbpassword;"

But I can't connect to this database from another computer using the host's IP address or the default database address (127.0.0.1). This is the connection string to connect to the host computer

connectionstring = "Host=192.168.0.122; Port=3306; database=dbname; user=dbuser; password=dbpassword;"

I get this error;

cannot connect to any of the specified mysql hosts

All privileges are enabled on the database and both computers are on the same network. What do I have to do to connect to the database from another computer? Please help!

Roberto
  • 21
  • 6
  • 127.0.0.1 == localhost, so it's quite obvious you can't connect to a remote machine using this ip address. Does the dbserver have a firewall? If yes, is port 3306 allowed for incoming connections? What is the value of `bind-address` in your mysql configuaration? – derpirscher May 23 '21 at 13:24
  • @derpirscher I have checked the my.ini file and it doesn't have the bind-address line. How do check if port 3306 is allowed for incoming connections? – Roberto May 23 '21 at 14:09

0 Answers0