MySQL error: Can't get hostname from your ip address

前端 未结 5 720
深忆病人
深忆病人 2020-12-14 04:39

I use my remote MySQL database during long time.

But today I suddenly have found that I cannot connect to the database. I have got an error.

5条回答
  •  孤城傲影
    2020-12-14 05:21

    I know this question was asked quite some time ago and most people have figured it out by now, but for those who haven't, here was my solution:

    Add the port number with the server name in you connection string

    connectionstring = "server=server;Port=3306;User Id=UserNAme;password=password;Persist Security Info=True;database=DatabaseName;convert zero datetime=true";
    

提交回复
热议问题