Migrating from MySQL Community Server to MariaDB

Seems like the connection to the DB works fine but it seems the syntax for Inserts is different.

Is there a simple way to configure maria db to accept MySQL like sql statments or must i re-write all my statements and have versions for both?

MariaDB is supposed to be a drop-in replacement for MySql. Where are you finding differences?

4 Likes

Simple Insert statement like
INSERT INTO Table (c, b, a) VALUES (c,b,a);
Where the table happens to be in a, b, c order.
I’m not sure if it’s the ` character that should have been a ’ character or if MariaDB wants data in the same order as the tables are ordered…

I’m not sure I want to use this statement any more due to sql vulnerabilites, i will eventually change to prepared statements as they are more secure.

When i remove the column names from the statement the insert works.

What’s error message you get from the database? That’s the first thing to look at when running into issues.

If the names of C, B or A are reserved words then they need to be enclosed in ` (that is a back apostrophe, not a standard one). For example

Var s as string = "INSERT INTO Table (`date`, b, a) VALUES (c,b,a);"