I’ve been working with MVC, CodeFirst and MySql Connector .NET for a while. Everything was working like a charm, so far.
But now, I’m facing a problem that I’m not being able to solve… For some reasons, I had to move the databases I’m using to another server. And I’m trying to do this in the simpler way: via .sql files.
After importing the databases’ content to the new server, the database structure was fine. But when the website tries to access the content of the databases via EF, weird problems occurs (MySql.Data.MySqlClient.MySqlException: Unknown column ‘Extent3.item’ in ‘field list’)
Trying to find answers to solve my problem, I realized that this kind of problem occurs because of relationships that are not being created properly using FKs. But, In my case it does not apply since everything was working before I try to move the databases.
Then, just came to my mind that some info about the database schema is stored somewhere by the connector(actually, I don’t know if this is true… But I think I read something like that somewhere). So, maybe, the problem is that I’m missing some information when I’m trying to export the database to .sql files.
So… I would like to know if I’m following the right steps in order to export and import my databases’ content to the new server. If I’m not, how am I supposed to proceed? If I am, what can be the source of my problem?
Thank you!
Problem solved.
The servers have different SOs. The old one, was running Windows. The new one runs Linux. Case sensitive for table names is turned on by default in linux MySQL and the old database wasn’t case sensitive. So, I only had to disable case sensitive table names in the new database.