locked
connect to mysql through remote srever iis RRS feed

  • Question

  • User-66583395 posted

    Hello, 

    i developed a website through .net using mysql. 
    i deployed my website to iis in my local windows 10 computer and it worked well. i could connect to the database using iis. 
    while i tried to deployed the website to an iis in another computer, also windows 10, the web worked fine, besides i couldn't connect to the mysql database, 
    while i have tested the connection with this remote computer to mysql, with ODBC connector, and the result is that there is a connection. 

    does anyone have a way to fix this problem? 

    thank you very much

    Monday, August 21, 2017 6:54 AM

Answers

  • User-460007017 posted

    Hi lir,

    Have you deployed the MySQL on the new server? It seems that the MySQL only allow the local connection, if you need to enable the remote connection for the IIS site, you may need to take actions to change the MySQL configuration. At least ensure the login connection string works fine in console. Then you may need to check the connection string in .net application works fine. Finally, ensure the authenticated user and application pool identity(IIS Apppool\<apppool name>) has the permission to display the result.

    In addition, please check whether the static content and ASP.net feature has been enabled in turn windows features on or off/add role and feature.

    Best Regards,

    Yuk Ding

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, August 22, 2017 2:25 AM

All replies

  • User-460007017 posted

    Hi lir,

    Have you deployed the MySQL on the new server? It seems that the MySQL only allow the local connection, if you need to enable the remote connection for the IIS site, you may need to take actions to change the MySQL configuration. At least ensure the login connection string works fine in console. Then you may need to check the connection string in .net application works fine. Finally, ensure the authenticated user and application pool identity(IIS Apppool\<apppool name>) has the permission to display the result.

    In addition, please check whether the static content and ASP.net feature has been enabled in turn windows features on or off/add role and feature.

    Best Regards,

    Yuk Ding

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, August 22, 2017 2:25 AM
  • User-66583395 posted

    Hi Yuk, thank you.

    it worked after i deployed the website in administration privileges,

    and after editing in the IIS Authentications "Anonymous user identity" to "Application pool identity".

    Best Regards,

    Lir

    Tuesday, August 22, 2017 6:30 AM