问题
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.
回答1:
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
Choose a Destination
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/
回答2:
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.
来源:https://stackoverflow.com/questions/55767227/migrating-from-mariadb-to-mysql-differences