Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将SQL文件导入新数据库时出错_Sql_Import_Mariadb_Wpn Xm - Fatal编程技术网

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

将SQL文件导入新数据库时出错,sql,import,mariadb,wpn-xm,Sql,Import,Mariadb,Wpn Xm,我正在从WAMP切换到WPN-XM作为我的本地开发设置。我了解到它使用MariaDB而不是MYSQL。Serve已设置,MariaDB正在运行 我将旧的WAMP DB导出到一个SQL文件中。当我使用WPN-XM的phpmyadmin导入数据库时,我得到一个红色错误MYSQL已经消失了 所以我尝试从mysql客户端源代码c:/myfile.sql导入,它会导入,但会出现很多错误,如 ERROR 1231 (4200 at line 31613 in file 'c:/myfile.sql: var

我正在从WAMP切换到WPN-XM作为我的本地开发设置。我了解到它使用MariaDB而不是MYSQL。Serve已设置,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文件从一个导入到另一个。为什么我在简单的导出和导入时会出错


非常感谢您的帮助。

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

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

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


似乎这就是导致错误的原因。一旦我重新导出,它将导入Maria DB fine。

好的,我通过谷歌搜索发现,你不能从MYSQL 5.36转到新的MariaDB 5.536,因为版本必须相同。它们必须是相同的版本,否则定义将不同。这就是为什么我会犯错误。制造。因此,除非有更好的主意,否则我会去研究如何将我的WAMP的MYSQL升级到5.5.36。我一直认为SQL是一种标准,可以将数据从一个版本移动到另一个版本,我想不会。实际上我将从MYSQL 5.5.16升级到5.5.36。在这个过程中,我的WAMP似乎是5.5.16版,但不确定这是怎么发生的。似乎足够接近的版本不会引起这么多的错误我知道这个老问题-但我偶然发现了这个,我发现我必须禁用压缩以及上述技术
INSERT INTO tbl_name VALUES (1,2,3)