Frage

I'm switching from WAMP to WPN-XM as my local development setup. I learned that it uses MariaDB instead of MYSQL. Serve is setup and MariaDB is running.

I exported my old WAMP DB into an SQL file. When I use WPN-XM's phpmyadmin to import the db, I get a red error MYSQL has gone away. ???

So I try and import from mysql client source c:/myfile.sql and it imports but I get many errors like

ERROR 1231 (4200 at line 31613 in file 'c:/myfile.sql: variable 'character_set_client' can't be set to a value of 'null'

ERROR 1075 (42000) at line 31476 in file: 'c:\nycgmc-dev.sql': Incorrect table definition; there can be only one auto column and it must be defined as a key
ERROR 1075 (42000) at line 31481 in file: 'c:\nycgmc-dev.sql': Incorrect table definition; there can be only one auto column and it must be defined as a key

Query OK, 0 rows affected (0.05 sec)
Records: 0  Duplicates: 0  Warnings: 0

ERROR 1075 (42000) at line 31491 in file: 'c:\nycgmc-dev.sql': Incorrect table definition; there can be only one auto column and it must be defined as a key
ERROR 1075 (42000) at line 31496 in file: 'c:\nycgmc-dev.sql': Incorrect table definition; there can be only one auto column and it must be defined as a key
ERROR 1075 (42000) at line 31501 in file: 'c:\nycgmc-dev.sql': Incorrect table definition; there can be only one auto column and it must be defined as a key
ERROR 1075 (42000) at line 31506 in file: 'c:\nycgmc-dev.sql': Incorrect table definition; there can be only one auto column and it must be defined as a key
ERROR 1075 (42000) at line 31511 in file: 'c:\nycgmc-dev.sql': Incorrect table definition; there can be only one auto column and it must be defined as a key
ERROR 1075 (42000) at line 31516 in file: 'c:\nycgmc-dev.sql': Incorrect table definition; there can be only one auto column and it must be defined as a key

I also get a lot of what should be there like

Query OK, 7 rows affected (0.10 sec)

when I view in phpMyAdmin I see all the tables but many are o bytes meaning no content, likely due to the errors.

I thought MySQL and MariaDB were pretty much the same and I should be able to import an SQL file from one to the other. Why am I having errors with a simple export and import?

Any help appreciated.

War es hilfreich?

Lösung

I was able to import from Mysql to MariaDB simply by adjusting the export SQL settings in PHPMyAdmin.

I changed from the default statement e.g:

INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)

to:

INSERT INTO tbl_name VALUES (1,2,3)

It seems like this was the issue that caused the error. Once I re-exported, it imported into Maria DB fine.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top