I am trying to set up an mvc project using entity framework code first and mysql. I have found some tutorials here and there but all of them say that after creating the classes and defining the connection string in the web.config file, running the
project will create the database and necessary tables. I have done this using the mysql connector reference and dataprovider in my web.config file but when I run the project, no database is generated. If I create the database first, no tables are created.
I don't receive any errors when it runs but it just doesn't work. From the tutorials I've seen it sounds like once I set up my models, set up the connction string in the web.config and create my dbcontext class it should generate the database and tables
upon first running and seeing that they don't exist. Is this not correct? If not, what step am I missing? Does anyone know of a good step by step tutorial for using EFCF and MySQL? Thanks.
Utter nonsense. I used EF code-first with MySQL in a project back in March. Although the provider isn't absolutely perfect, it works reasonably well.
The one thing that didn't work, at least with the version of Connector/Net I was using, was creating the database or tables. Once I had created them manually, the code worked fine.
Marked as answer by gswartz on Sep 11, 2012 08:07 PM
Utter nonsense. I used EF code-first with MySQL in a project back in March. Although the provider isn't absolutely perfect, it works reasonably well.
I was able to get the connector working in other test projects with mvc4 and mysql just fine. I guess I won't be doing teh code first approach yet. Thanks.
Could you please give me or point to tutorial abt this? I am having VS express 2012 and was able to use sql express without any issue. But not able to work with mysql. Any help on this topic would be appreciated.
gswartz
Member
5 Points
22 Posts
entity framework code first and mysql
Sep 10, 2012 10:34 PM|LINK
I am trying to set up an mvc project using entity framework code first and mysql. I have found some tutorials here and there but all of them say that after creating the classes and defining the connection string in the web.config file, running the project will create the database and necessary tables. I have done this using the mysql connector reference and dataprovider in my web.config file but when I run the project, no database is generated. If I create the database first, no tables are created.
I don't receive any errors when it runs but it just doesn't work. From the tutorials I've seen it sounds like once I set up my models, set up the connction string in the web.config and create my dbcontext class it should generate the database and tables upon first running and seeing that they don't exist. Is this not correct? If not, what step am I missing? Does anyone know of a good step by step tutorial for using EFCF and MySQL? Thanks.
mysql mvc EntityFramework
thaicarrot
Contributor
5130 Points
1464 Posts
Re: entity framework code first and mysql
Sep 11, 2012 06:52 PM|LINK
At this time impossible to use EF with MySQL.
Weera
RichardD
Contributor
3950 Points
549 Posts
Re: entity framework code first and mysql
Sep 11, 2012 07:16 PM|LINK
Utter nonsense. I used EF code-first with MySQL in a project back in March. Although the provider isn't absolutely perfect, it works reasonably well.
The one thing that didn't work, at least with the version of Connector/Net I was using, was creating the database or tables. Once I had created them manually, the code worked fine.
gswartz
Member
5 Points
22 Posts
Re: entity framework code first and mysql
Sep 11, 2012 08:07 PM|LINK
I was able to get the connector working in other test projects with mvc4 and mysql just fine. I guess I won't be doing teh code first approach yet. Thanks.
nagasx
Member
2 Points
1 Post
Re: entity framework code first and mysql
Dec 14, 2012 06:15 PM|LINK
Could you please give me or point to tutorial abt this? I am having VS express 2012 and was able to use sql express without any issue. But not able to work with mysql. Any help on this topic would be appreciated.
Thanks,
Suresh