将SQL文件导入新的MariaDB数据库时出错

时间:2014-05-09 19:43:28

标签: sql import mariadb wpn-xm

我作为本地开发设置从WAMP切换到WPN-XM。我了解到它使用MariaDB而不是MYSQL。服务已设置且MariaDB正在运行。

我将旧的WAMP DB导出到SQL文件中。当我使用WPN-XM的phpmyadmin导入数据库时​​,我得到一个红色错误MYSQL消失了。 ???

所以我尝试从mysql客户端源c:/myfile.sql导入并导入但是我收到很多错误,比如

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

我也得到很多应该有的东西,如

Query OK, 7 rows affected (0.10 sec)

当我在phpMyAdmin中查看时,我看到所有表格,但很多都是o字节,意味着没有内容,可能是由于错误。

我认为MySQL和MariaDB几乎相同,我应该能够将SQL文件从一个导入到另一个。为什么我的简单导出和导入出错?

任何帮助表示感谢。

1 个答案:

答案 0 :(得分:5)

我只需通过调整PHPMyAdmin中的导出SQL设置就可以从Mysql导入到MariaDB。

我改变了默认语句,例如:

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

为:

INSERT INTO tbl_name VALUES (1,2,3)

这似乎是导致错误的问题。一旦我重新导出,就可以很好地导入Maria DB。