Unable to connect to any of the specified mysql hosts. C# MySQL

后端 未结 15 1428
庸人自扰
庸人自扰 2020-11-29 07:11

I am getting the above error when I execute the code -

MySqlConnection mysqlConn=new MySqlConnection(\"server=127.0.0.1;uid=pankaj;port=3306;pwd=master;datab         


        
15条回答
  •  遥遥无期
    2020-11-29 07:39

    I was having the exact same error.

    Here's what you need to do:

    If you are using MAMP, close your server. Then click on the preferences button when you open up MAMP again (before restarting your server of course).

    Then you will need to click on the ports tab, and click the button "Set Web and MySQL Ports to 80 & 3306".

提交回复
热议问题