2

I have ASP.Net MVC site & using EF Code First

As Database, I am using MySql. But not getting the right connection string. If it was MSSQL I could have easily generate using Visual Studio itself.

Is there a quick way to auto generate the right connection string when using MySql.

Thanks.

2 Answers 2

4

This could be useful

<connectionStrings>
   <add name="MyContext" providerName="MySql.Data.MySqlClient"
    connectionString="server=localhost;port=3306;database=mydbname;uid=my_user_id;password=my_password"/>
</connectionStrings>

tipically the my_user_id = root

https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html

Sign up to request clarification or add additional context in comments.

1 Comment

Can you please look into this related question. stackoverflow.com/questions/40572912/…
0

While adding the edmx file (under data tab) you have select generate from existing db. And select mysql db for more details follow the complete guide here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.