MySQL–notes to support the use of MySQL with MDriven

This article was moved to MDriven Wiki MySQL–notes to support the use of MySQL with MDriven

Hand on heart – I use SQLServer most of the time. So when I am asked questions about MySQL I always need to go out of my comfort zone.

This article can hopefully help me in my efforts with this and hopefully help you as well.

  1. Make sue you have MySql installed – the server and not only the connectors – you need both for local work of course
  2. Start a cmd window as admin and cd to c:\program files\MySql\MySql server <version>\bin
  3. Start mysql.exe – if asked for a password it is probably “root”
  4. you should now have a mysql> prompt
  5. Create a database called my1 : CREATE DATABASE my1;
  6. Use a database called my1: USE my1

 

Ok – now we have the database – switch back to MDriven:

We want to use the my1 db:

image

 

Change to PersistenceMapperMySql, make sure it is used in EcoProject1.PersistenceMapper= PersistenceMapperMySql1, set its connection string to “server=localhost;database=my1;User Id=root;password=root; Charset=utf8”

  • Generate code if you have not already
  • Compile if you have not already
  • Then Generate database.

If you get this error:

image

… it is due to the SupportsFilteredIndex setting :

image

Change it to false.

 

Another thing that differs from SqlServer is the Top keyword as in “select top 15 * from stuff” is written as “select * from stuff limit 15” in MySQL

This is fixed by changing these properties of the persistenceMapperMySQL.SqlDatabaseConfig:

SqlTopKeyword – set this to empty string
SqlTopQuerySuffix – set this to limit {0}

like this:

image

From today these settings are automatically applied when pressing the MySql 5.0 Setup option found here:

 

image

This entry was posted in ThirdParty, VisualStudio. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.