phpMyAdmin不允许我一次运行多个查询,并且导入SQL失败 [英] phpMyAdmin doesn't let me run more than one query at a time, and importing my SQL fails

查看:55
本文介绍了phpMyAdmin不允许我一次运行多个查询,并且导入SQL失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个要导入的大型SQL文件.我通过解析旧的MySQL数据库的CSV导出中的数据来生成这些SQL文件.如果我尝试将它们导入到新的MySQL数据库中,则需要花费几分钟,并最终说它通过了.但是当我查看表时,没有INSERT语句对表有任何作用.

I have two large SQL files that I'm trying to import. I generated these SQL files by parsing out data from an old MySQL database's CSV export. If I try to import these into the new MySQL database, it takes a few minutes and eventually says that it passed. But when I look at the tables, none of the INSERT statements did anything to the tables.

如果我在phpMyAdmin SQL窗口中一一运行SQL文件中的语句,它们将成功地将记录插入表中.因此,我尝试将整个SQL文件复制并粘贴到窗口中.需要一段时间,但最终我得到一个错误代码:500.

If I run the statements in my SQL files one by one in the phpMyAdmin SQL window, they successfully insert records into the tables. So I tried to copy and paste the entire SQL files into window. It takes a while but eventually I get an Error code: 500.

我应该如何解决这个问题?连接到数据库非常烦人且令人沮丧,因为我不知道在哪里可以找到有关数据库的所有信息,并且由于到目前为止我发现的所有资源都告诉我如何连接到本地数据库而不是本地数据库.托管在其他地方.我只想导入这些SQL文件并完成它.我只是想将一堆东西插入两个表中.这是SQL的示例:

How am I supposed to solve this issue? Connecting to the database is annoyingly stupid and frustrating since I don't know where to find all of the information about the database and since all the resources I've found so far tell me how to connect to a local database rather than one that is hosted elsewhere. I just want to import these SQL files and be done with it. I'm just trying to insert a bunch of things into two tables. Here's a sample of the SQL:

INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('base_fee_paid', 0)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('featured_paid', 0)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('private_bids_paid', 0)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('do_not_require_shipping', 0)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('featured', 1)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('allow-offers', 0)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('Location', 'California')
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('quant', 1)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('buy_now', 130.0)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('reserve', 0)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('private_bids', 'no')
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('only_buy_now', 1)
INSERT INTO b1b_postmeta (meta_key, meta_value)
VALUES ('auto_renew_item', 0)

来自其中一个SQL文件.另一个SQL文件类似,但是将一些不同的数据插入到不同的表中.如果我在phpMyAdmin SQL窗口中逐一运行INSERT语句,则插入它们不会出现问题.但是,如果我尝试导入整个文件...它说这是成功的,但是当我查看表格时,看不到更改.感谢您的任何建议.

That's from one of the SQL files. The other SQL file is similar but inserting some different data into a different table. If I run the INSERT statements up above one by one in the phpMyAdmin SQL window, they get inserted no problem. But if I try to import the entire file...it says that it was a success but when I look at the table, I don't see the changes. Thanks for any suggestions.

注意:我刚刚共享的SQL块只是一个块.对于每种产品,我们都有一个类似的块.在那个块之后是一个空格,后面是另一个块.我添加了空格,以便在查看SQL文件时可以更轻松地区分不同的产品.较大的SQL文件约为100,000行.另一条大约是20,000行.

Note: The SQL block I just shared is just one block. For each product, we have a block like that. After that block is a space followed by another block. I included spaces so that I could more easily differentiate between the different products if I was looking at the SQL file. The bigger SQL file is around 100,000 lines. The other one is around 20,000 lines.

推荐答案

; 分隔命令,例如:

INSERT INTO b1b_postmeta (meta_key, meta_value) VALUES ('only_buy_now', 1);
INSERT INTO b1b_postmeta (meta_key, meta_value) VALUES ('auto_renew_item', 0);

正如我在评论中所述 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆