-2

I am working on a small social network (just to fill my free time) and I started with a Maria database. But I had some problems with it (long story) so I changed it to a MySQL database. But after this, I am not able to insert values into some tables (for example with Maria I inserted values to "messages" table with no problem and now when I have MySQL it won´t insert values to this table).

I don´t know very much about the differences between those two databases. Can this be the reason why it is not working - change from Maria to MySQL? Is it possible that Maria "supports" something that MySQL does not? I don´t get any errors, it just does not insert values to the table.

Lin Du
  • 88,126
  • 95
  • 281
  • 483
Paula
  • 37
  • 5
  • How did you migrate the data? What are the versions? – Paul Spiegel Apr 19 '19 at 20:06
  • I exported my MySQL database and I created a new MariaDB, then I pasted the code in SQL (phpMyAdmin). So I just imported the same tables into a new made Maria. – Paula Apr 19 '19 at 20:09
  • 1
    If you use `INSERT` without `IGNORE` the data must be either inserted or you should get an error. If not, then your installation is broken. But I guess that you just don't see the inserted rows, because phpMyAdmin aplies a LIMIT to the queries, so you only see like the first 30 rows. – Paul Spiegel Apr 19 '19 at 20:15
  • Make sure you actually [display php errors](https://stackoverflow.com/q/22662488). – Solarflare Apr 19 '19 at 20:22

2 Answers2

0

Read this link https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility/ which discusses in detail the compatibility issues between various versions of MariaDB and MySQL:

And there was a toolkit called ESF Database Migration Toolkit

Choose a Data Source

enter image description here

Choose a Destination

enter image description here

ESF Database Migration Toolkit ( http://www.easyfrom.net/ ): This toolkit dramatically cuts the effort, cost, and risk of migrating to/from any of the following database/file systems: Oracle, MySQL, SQL Server, PostgreSQL, IBM DB2, IBM Informix, InterSystems Caché, Teradata, Visual Foxpro, SQLite, FireBird, InterBase, Microsoft Access, Microsoft Excel, Paradox, Lotus, dBase, CSV/Text and transfer any ODBC DSN data source to them.

Read this: https://www.easyfrom.net/articles/mariadb_to_mysql/

Sachith Wickramaarachchi
  • 5,546
  • 6
  • 39
  • 68
0

I could not find a straight forward way to migrate from MariaDB to MySQL. This is what I did to get my job done. You can -

export the database without a schema like this

mysqldump --no-create-info --complete-insert -u$user -p$pass $database_name | sed -e "s/\\\'/''/g"  > dump.sql

--no-create-info (to skip schema)

--complete-insert (to get the column names with the values)

| sed -e "s/\\'/''/g" (to replace ' with '' from the stream)

then just run your migration to create your tables and import the dump.sql, hope this helps.