41 个解决方案
#1
***.sql 的内容是什么?
打开另一个MYSQL连接,看看当前的processlist
打开另一个MYSQL连接,看看当前的processlist
#2
没报错就慢慢等着 sql脚本导入本来就慢
#3
mysql> show processlist;
+----+------+----------------+--------------------+---------+------+-------+----
--------------+
| Id | User | Host | db | Command | Time | State | Inf
o |
+----+------+----------------+--------------------+---------+------+-------+----
--------------+
| 2 | root | localhost:2284 | gamerecord-chn1030 | Sleep | 188 | | NUL
L |
| 3 | root | localhost:2285 | NULL | Sleep | 568 | | NUL
L |
| 6 | root | localhost:2290 | gamerecord-chn1030 | Sleep | 514 | | NUL
L |
| 7 | root | localhost:2572 | NULL | Query | 0 | NULL | sho
w processlist |
+----+------+----------------+--------------------+---------+------+-------+----
#4
应该没有啥限制吧,有限制的时候,会报错啊,你看看错误日志里面有记录吗?
#5
我已经等很久很久了,还是没反应,数据库里面也没数据啊,还是空的
#6
那是试试导出个小点的库,在用你上面的命令导入试试
#7
小的库是可以导入的,我已经试了
#8
my.ini文件里面加了max_allowed_packet=600M
show variables like 'max_allowed_packet'
用编辑器看看。sql的内容是什么
show variables like 'max_allowed_packet'
用编辑器看看。sql的内容是什么
#9
show variables like 'max_allowed_packet'
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 629145600 |
+--------------------+-----------+
1 row in set (0.00 sec)
已经生效了,但是为什么就是不行呢,sql文件的内容就是一个insert语句,批量插入数据,数据比较多
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 629145600 |
+--------------------+-----------+
1 row in set (0.00 sec)
已经生效了,但是为什么就是不行呢,sql文件的内容就是一个insert语句,批量插入数据,数据比较多
#10
这三个哪个是你导入数据的连接?
估计问题在你的***.sql文件中。
估计问题在你的***.sql文件中。
#11
use gamerecord-chn1030;
insert into itemrecord_5(Time,PlayerA,Type,ScriptID,MapA,MapAx,MapAy,PlayerLevel,GetExp,PlayerExp,PlayerMaxExp,NpcTypeID) values
("2011-3-29 17:54:40",8631790509,5,5,352,1028,1127,125,6194,1181892640,1350000000,4435),
("2011-3-29 15:2:54",47507717618,5,5,12,12312,3228,86,63,53101780,64000000,4140),
("2011-3-29 14:48:37",60449502696,5,5,22,5080,6055,104,2300,94621002,230000000,4304),
("2011-3-29 22:17:35",4307438554,5,5,12,11360,11533,78,42,6954105,34000000,4126),
("2011-3-29 9:16:55",86421393336,5,5,13,5326,5237,90,70,71029148,82000000,4226),
("2011-3-29 23:57:56",4307247342,5,5,12,5064,8705,84,52,2924052,56000000,4127),
("2011-3-29 7:51:9",4307438554,5,5,12,11547,11670,78,42,5763594,34000000,4126),
("2011-3-29 22:56:13",69080810480,5,5,26,2167,1088,126,4332,1242395430,1470000000,4383),
("2011-3-29 3:51:28",4307247342,5,5,12,5064,8812,84,52,1088456,56000000,4127),
("2011-3-29 22:50:40",69080810480,5,5,26,2251,1117,126,4332,1241592621,1470000000,4383),
("2011-3-29 11:42:55",56147847144,5,5,14,3331,1277,78,500,24827096,34000000,4228),
("2011-3-29 17:15:44",47507720342,5,5,12,12243,3450,86,63,51651660,64000000,4132),
("2011-3-29 14:43:26",4295032890,5,5,13,5480,3348,88,60,58418940,72000000,4226),
("2011-3-29 17:41:5",86421378305,5,5,14,1485,2941,92,70,20697541,94000000,4225),
("2011-3-29 13:48:50",47507717618,5,5,12,12136,3356,86,63,52927422,64000000,4132),
("2011-3-29 17:31:3",86421378305,5,5,14,1076,3019,92,82,20681303,94000000,4225),
("2011-3-29 21:27:21",99374730180,5,5,26,5829,2538,127,3932,1284453278,1590000000,4383),
("2011-3-29 20:6:37",4295013659,5,5,13,4920,3796,88,70,68598067,72000000,4226),
("2011-3-29 22:35:57",86421378305,5,5,14,1252,2968,92,414,21210040,94000000,4225),
("2011-3-29 11:50:39",108062031492,5,5,17,8798,3137,93,300,31264527,100000000,4235),
("2011-3-29 8:38:39",4295032890,5,5,13,4997,3523,88,70,57863817,72000000,4226),
("2011-3-29 18:37:55",86422143767,5,5,13,4986,4895,90,60,56839521,82000000,4226),
("2011-3-29 3:4:22",17237246542,5,5,308,1040,1077,114,3230,262705176,580000000,4377),
("2011-3-29 13:2:20",4295019008,5,5,13,4684,3438,88,60,46498406,72000000,4226),
("2011-3-29 2:9:50",99374730180,5,5,26,5136,2220,127,3932,1275949796,1590000000,4383),
("2011-3-29 9:16:58",47507720342,5,5,12,12394,3365,86,63,50558914,64000000,4132),
("2011-3-29 15:17:28",4295267863,5,5,12,10491,879,88,63,22698116,72000000,4132),
("2011-3-29 20:51:42",103726644678,5,5,13,5599,5033,90,60,27045128,82000000,4226),
("2011-3-29 0:20:2",4307437863,5,5,12,11704,11518,83,42,13933708,52000000,4126),
("2011-3-29 9:24:49",86421393336,5,5,13,5800,5396,90,87,71042135,82000000,4226),
("2011-3-29 6:54:7",4307249738,5,5,12,5064,8652,83,52,23891086,52000000,4138),
("2011-3-29 3:1:50",86421393931,5,5,13,5336,5496,90,70,61775766,82000000,4226),
("2011-3-29 0:3:46",47504635734,5,5,13,9136,3377,88,62,64719617,72000000,4227),
("2011-3-29 14:15:49",51815203938,5,5,24,4746,5276,119,1769,562078656,830000000,4336),
("2011-3-29 19:35:40",4307248544,5,5,12,4981,8897,83,52,37743769,52000000,4138),
("2011-3-29 23:56:47",56128945985,5,5,19,8812,2238,91,474,52555963,88000000,4271),
("2011-3-29 10:33:15",56139983951,5,5,18,5133,4127,83,656,45015586,52000000,4236),
("2011-3-29 19:27:24",4307345229,5,5,12,11709,11737,83,52,13743393,52000000,4126),
("2011-3-29 9:45:11",4307247342,5,5,12,4861,8870,84,52,1557830,56000000,4127),
("2011-3-29 14:34:50",47504626603,5,5,14,3189,3743,91,70,52393055,88000000,4225),
("2011-3-29 0:33:20",112368188870,5,5,352,4229,1848,126,4129,498408392,1470000000,4435),
("2011-3-29 9:40:53",4307345229,5,5,12,11725,11267,83,42,12929404,52000000,4126),
("2011-3-29 17:39:9",17237246542,5,5,23,6262,7858,114,2860,287169730,580000000,4333),
("2011-3-29 14:51:37",99374730180,5,5,26,5241,2362,127,3932,1278688966,1590000000,4383),
("2011-3-29 16:11:44",4295267863,5,5,12,10894,877,88,63,22800654,72000000,4132),
("2011-3-29 8:31:38",47504628791,5,5,13,8181,3229,91,62,34983481,88000000,4227),
("2011-3-29 19:11:0",108067999319,5,5,13,11367,4353,90,62,37290280,82000000,4227),
("2011-3-29 9:45:13",108063303476,5,5,13,11209,4119,91,62,87407924,88000000,4227),
insert into itemrecord_5(Time,PlayerA,Type,ScriptID,MapA,MapAx,MapAy,PlayerLevel,GetExp,PlayerExp,PlayerMaxExp,NpcTypeID) values
("2011-3-29 17:54:40",8631790509,5,5,352,1028,1127,125,6194,1181892640,1350000000,4435),
("2011-3-29 15:2:54",47507717618,5,5,12,12312,3228,86,63,53101780,64000000,4140),
("2011-3-29 14:48:37",60449502696,5,5,22,5080,6055,104,2300,94621002,230000000,4304),
("2011-3-29 22:17:35",4307438554,5,5,12,11360,11533,78,42,6954105,34000000,4126),
("2011-3-29 9:16:55",86421393336,5,5,13,5326,5237,90,70,71029148,82000000,4226),
("2011-3-29 23:57:56",4307247342,5,5,12,5064,8705,84,52,2924052,56000000,4127),
("2011-3-29 7:51:9",4307438554,5,5,12,11547,11670,78,42,5763594,34000000,4126),
("2011-3-29 22:56:13",69080810480,5,5,26,2167,1088,126,4332,1242395430,1470000000,4383),
("2011-3-29 3:51:28",4307247342,5,5,12,5064,8812,84,52,1088456,56000000,4127),
("2011-3-29 22:50:40",69080810480,5,5,26,2251,1117,126,4332,1241592621,1470000000,4383),
("2011-3-29 11:42:55",56147847144,5,5,14,3331,1277,78,500,24827096,34000000,4228),
("2011-3-29 17:15:44",47507720342,5,5,12,12243,3450,86,63,51651660,64000000,4132),
("2011-3-29 14:43:26",4295032890,5,5,13,5480,3348,88,60,58418940,72000000,4226),
("2011-3-29 17:41:5",86421378305,5,5,14,1485,2941,92,70,20697541,94000000,4225),
("2011-3-29 13:48:50",47507717618,5,5,12,12136,3356,86,63,52927422,64000000,4132),
("2011-3-29 17:31:3",86421378305,5,5,14,1076,3019,92,82,20681303,94000000,4225),
("2011-3-29 21:27:21",99374730180,5,5,26,5829,2538,127,3932,1284453278,1590000000,4383),
("2011-3-29 20:6:37",4295013659,5,5,13,4920,3796,88,70,68598067,72000000,4226),
("2011-3-29 22:35:57",86421378305,5,5,14,1252,2968,92,414,21210040,94000000,4225),
("2011-3-29 11:50:39",108062031492,5,5,17,8798,3137,93,300,31264527,100000000,4235),
("2011-3-29 8:38:39",4295032890,5,5,13,4997,3523,88,70,57863817,72000000,4226),
("2011-3-29 18:37:55",86422143767,5,5,13,4986,4895,90,60,56839521,82000000,4226),
("2011-3-29 3:4:22",17237246542,5,5,308,1040,1077,114,3230,262705176,580000000,4377),
("2011-3-29 13:2:20",4295019008,5,5,13,4684,3438,88,60,46498406,72000000,4226),
("2011-3-29 2:9:50",99374730180,5,5,26,5136,2220,127,3932,1275949796,1590000000,4383),
("2011-3-29 9:16:58",47507720342,5,5,12,12394,3365,86,63,50558914,64000000,4132),
("2011-3-29 15:17:28",4295267863,5,5,12,10491,879,88,63,22698116,72000000,4132),
("2011-3-29 20:51:42",103726644678,5,5,13,5599,5033,90,60,27045128,82000000,4226),
("2011-3-29 0:20:2",4307437863,5,5,12,11704,11518,83,42,13933708,52000000,4126),
("2011-3-29 9:24:49",86421393336,5,5,13,5800,5396,90,87,71042135,82000000,4226),
("2011-3-29 6:54:7",4307249738,5,5,12,5064,8652,83,52,23891086,52000000,4138),
("2011-3-29 3:1:50",86421393931,5,5,13,5336,5496,90,70,61775766,82000000,4226),
("2011-3-29 0:3:46",47504635734,5,5,13,9136,3377,88,62,64719617,72000000,4227),
("2011-3-29 14:15:49",51815203938,5,5,24,4746,5276,119,1769,562078656,830000000,4336),
("2011-3-29 19:35:40",4307248544,5,5,12,4981,8897,83,52,37743769,52000000,4138),
("2011-3-29 23:56:47",56128945985,5,5,19,8812,2238,91,474,52555963,88000000,4271),
("2011-3-29 10:33:15",56139983951,5,5,18,5133,4127,83,656,45015586,52000000,4236),
("2011-3-29 19:27:24",4307345229,5,5,12,11709,11737,83,52,13743393,52000000,4126),
("2011-3-29 9:45:11",4307247342,5,5,12,4861,8870,84,52,1557830,56000000,4127),
("2011-3-29 14:34:50",47504626603,5,5,14,3189,3743,91,70,52393055,88000000,4225),
("2011-3-29 0:33:20",112368188870,5,5,352,4229,1848,126,4129,498408392,1470000000,4435),
("2011-3-29 9:40:53",4307345229,5,5,12,11725,11267,83,42,12929404,52000000,4126),
("2011-3-29 17:39:9",17237246542,5,5,23,6262,7858,114,2860,287169730,580000000,4333),
("2011-3-29 14:51:37",99374730180,5,5,26,5241,2362,127,3932,1278688966,1590000000,4383),
("2011-3-29 16:11:44",4295267863,5,5,12,10894,877,88,63,22800654,72000000,4132),
("2011-3-29 8:31:38",47504628791,5,5,13,8181,3229,91,62,34983481,88000000,4227),
("2011-3-29 19:11:0",108067999319,5,5,13,11367,4353,90,62,37290280,82000000,4227),
("2011-3-29 9:45:13",108063303476,5,5,13,11209,4119,91,62,87407924,88000000,4227),
#12
sql文件应该是没有问题的,我是用批处理生成的这个sql文件,文件小的时候是可以导进去的,几十M的都可以导进去,不知道这个一百多M就导不进去了,一直停在那里没动
#13
gamerecord-chn1030我是导入这个数据库
| 6 | root | localhost:2290 | gamerecord-chn1030 | Sleep |……
是这个进程
#14
说明一个语句都没有提交。 最大的可能是你的文件中的语句没有结束。 比如 引号的不匹配等等原因。 你不能指望我能猜出准确的问题。
建议你打开这个SQL文件后,一句一句直接贴到MYSQL中执行,然后就可以看到什么问题了。
use gamerecord-chn1030;
这句本身就有问题,你自己试一下。
#15
sql文件中的语句是绝对没有问题的,语句已经结束了,我把文件的后半部分删除,只留前半部分,大概有六十多M是可以插入进去的,这插入数据的过程是不是先要把文件读到内存中然后再插入呢?应该是某个设置给限制了读不了那么大的问题,我个人认为!
#16
应该不是啊,这个不是MYSQL中控制的,这个是操作系统来实现的。操作系统 把<xxxx 中的文件内容读出然后原样传递给前面的程序。
这样,你可以打开MYSQL的一般通用日志,然后可以看到 MYSQL中到底有没有执行提交的语句。
这样,你可以打开MYSQL的一般通用日志,然后可以看到 MYSQL中到底有没有执行提交的语句。
#17
一般通用日志??在哪里查?
#18
CREATE TABLE `itemrecord_5` (
`Id` int(11) NOT NULL auto_increment,
`Time` datetime NOT NULL default '1900-01-01 00:00:00',
`PlayerA` bigint(20) NOT NULL default '0',
`Type` int(1) NOT NULL default '0',
`ScriptID` int(11) default NULL,
`MapA` int(11) default NULL,
`MapAx` int(11) default NULL,
`MapAy` int(11) default NULL,
`PlayerLevel` int(11) default NULL,
`GetExp` bigint(20) default NULL,
`PlayerExp` bigint(20) default NULL,
`PlayerMaxExp` bigint(20) default NULL,
`NpcTypeID` int(11) default NULL,
PRIMARY KEY (`Id`)
) ENGINE=MyISAM AUTO_INCREMENT=143035528 DEFAULT CHARSET=utf8;
这是表的格式,你可以建一个把我上面发上来的内容复制到一百M试试
`Id` int(11) NOT NULL auto_increment,
`Time` datetime NOT NULL default '1900-01-01 00:00:00',
`PlayerA` bigint(20) NOT NULL default '0',
`Type` int(1) NOT NULL default '0',
`ScriptID` int(11) default NULL,
`MapA` int(11) default NULL,
`MapAx` int(11) default NULL,
`MapAy` int(11) default NULL,
`PlayerLevel` int(11) default NULL,
`GetExp` bigint(20) default NULL,
`PlayerExp` bigint(20) default NULL,
`PlayerMaxExp` bigint(20) default NULL,
`NpcTypeID` int(11) default NULL,
PRIMARY KEY (`Id`)
) ENGINE=MyISAM AUTO_INCREMENT=143035528 DEFAULT CHARSET=utf8;
这是表的格式,你可以建一个把我上面发上来的内容复制到一百M试试
#19
#20
大哥哥呀,400M 来~ 用一般的文本编辑器打开都是问题,更何况一条一条的看,看的楼主两眼冒金花
我的建议是,在快下班的时候,关闭数据库其它链接,重新执行,第二天来了再看结果
要么超时报错,要么成功!
执行了一段时间在数据库里面看不到,可能是因为数据库使用了缓存机制吧!毕竟400M不是个小数字,多等等
#21
分批导,应该。sql文件的问题,因为小文件可以嘛
#22
我已经执行完成了 在日志文件里面看到error日志提示是这样的
110415 9:45:36 [ERROR] E:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Out of memory (Needed 1992016 bytes)
110415 9:45:36 [ERROR] Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
#23
所以看来原因很简单啊,是内存不足
#24
内存不足,那要咋整,配置文件可以设置的吗?
#25
你的SQL是不是
INSERT INTO tab (....)
VALUES
(line1....),
(line2....),
(line3....),
......
(line9999999....);
啊,建议分成每100个一句insert
INSERT INTO tab (....)
VALUES
(line1....),
(line2....),
(line3....),
......
(line9999999....);
啊,建议分成每100个一句insert
#26
分成若干个文件吧,怎么分你根据实际情况而定
比如你在生成的时候,多加些条件,比如满足A条件的生成一个文件,满足B的再生成一个文件....
#27
你是用MSYQLDUMP全备的吧,这样备份是没办法的。
就1个SQL写入数据数据,当然大了
就1个SQL写入数据数据,当然大了
#28
#29
对的,我就是这样插入数据的,下面数据太多了 每一百行写一个insert?这样就可以?
#30
换个大内存机子,或者多添加几个虚拟内存文件。
用64位os+64位mysql导入,然后再把表文件复制出来。
把你的sql文件压缩了,也就30多M,传给我们这些dba,让他们用公司服务器帮你干活~~也就几分钟。
全都是最简单直接能解决问题的方案啊~~~
用64位os+64位mysql导入,然后再把表文件复制出来。
把你的sql文件压缩了,也就30多M,传给我们这些dba,让他们用公司服务器帮你干活~~也就几分钟。
全都是最简单直接能解决问题的方案啊~~~
#31
我自己就是管服务器的,我要做的是一个自动导日志的脚本,我是在xp本机上测试报内存不足,我拿到服务器上试mysql服务会自动停止?不知道原因
#32
你xp和服务器硬件啥配置啊?
你是说若干条数据库语句累死了mysql? 请放出sql文件下载地址,其中要含建表语句,估计有人感兴趣~~
你是说若干条数据库语句累死了mysql? 请放出sql文件下载地址,其中要含建表语句,估计有人感兴趣~~
#33
一条Insert语句默认是一个隐式事务。你写成一条SQL语句,要等所有的数据Load到数据库事务再提交。建议你,写成多条Insert 语句(我相信后面的值不是手动输入的吧,几百MB,手动输入,累死个人哦)。
#34
弱弱的问一下,为什么现在还没有人发明:直接把.SQL文件转换成.MYD文件的呢?
#35
进数据数据库
use databasename;
set names 'xxx' ; //你文件的编码
source /xxx/xx.sql;
我的2G多,都没有问题!
有问题会给你提示消息
use databasename;
set names 'xxx' ; //你文件的编码
source /xxx/xx.sql;
我的2G多,都没有问题!
有问题会给你提示消息
#36
后面的当然不是手动输入的撒,这么多要我一个一个输那我可以去死了,我是用脚本自动生成的,问题就是后面数据太大,每次试验吧要等很久最后还没导进去,郁闷死我了!
#37
我是用脚本导入,脚本用不了mysql命令,只能用mysql命令导入sql文件
#38
有什么不同吗?
我上面的是直接中登录mysql后在命令行的
你也可以写在程序代码中
php
mysql_query('xxxx');
mysql_query('ssxxxx');
一样执行
#39
我用的是批处理,冒似好像不行吧!
#40
批处理用source这命令怎么用?
我现在用的就是用mysql -uroot -p123456<***\***.sql
我用批处理只会这么导,还有没有别的更好的办法,
#41
你400M是一句SQL,程序需要一口气全部读入内存,并解析,开销太大,所以分成100行一个INSERT。
这就好比你搬家,你现在的家当太多,如果一次性搬的话,你需要一个集装箱,可是你的小区根本进不了那么大的车子,而且你的财力也只够雇个2吨的小卡车,那你只能分批一批批来
#1
***.sql 的内容是什么?
打开另一个MYSQL连接,看看当前的processlist
打开另一个MYSQL连接,看看当前的processlist
#2
没报错就慢慢等着 sql脚本导入本来就慢
#3
mysql> show processlist;
+----+------+----------------+--------------------+---------+------+-------+----
--------------+
| Id | User | Host | db | Command | Time | State | Inf
o |
+----+------+----------------+--------------------+---------+------+-------+----
--------------+
| 2 | root | localhost:2284 | gamerecord-chn1030 | Sleep | 188 | | NUL
L |
| 3 | root | localhost:2285 | NULL | Sleep | 568 | | NUL
L |
| 6 | root | localhost:2290 | gamerecord-chn1030 | Sleep | 514 | | NUL
L |
| 7 | root | localhost:2572 | NULL | Query | 0 | NULL | sho
w processlist |
+----+------+----------------+--------------------+---------+------+-------+----
#4
应该没有啥限制吧,有限制的时候,会报错啊,你看看错误日志里面有记录吗?
#5
我已经等很久很久了,还是没反应,数据库里面也没数据啊,还是空的
#6
那是试试导出个小点的库,在用你上面的命令导入试试
#7
小的库是可以导入的,我已经试了
#8
my.ini文件里面加了max_allowed_packet=600M
show variables like 'max_allowed_packet'
用编辑器看看。sql的内容是什么
show variables like 'max_allowed_packet'
用编辑器看看。sql的内容是什么
#9
show variables like 'max_allowed_packet'
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 629145600 |
+--------------------+-----------+
1 row in set (0.00 sec)
已经生效了,但是为什么就是不行呢,sql文件的内容就是一个insert语句,批量插入数据,数据比较多
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 629145600 |
+--------------------+-----------+
1 row in set (0.00 sec)
已经生效了,但是为什么就是不行呢,sql文件的内容就是一个insert语句,批量插入数据,数据比较多
#10
这三个哪个是你导入数据的连接?
估计问题在你的***.sql文件中。
估计问题在你的***.sql文件中。
#11
use gamerecord-chn1030;
insert into itemrecord_5(Time,PlayerA,Type,ScriptID,MapA,MapAx,MapAy,PlayerLevel,GetExp,PlayerExp,PlayerMaxExp,NpcTypeID) values
("2011-3-29 17:54:40",8631790509,5,5,352,1028,1127,125,6194,1181892640,1350000000,4435),
("2011-3-29 15:2:54",47507717618,5,5,12,12312,3228,86,63,53101780,64000000,4140),
("2011-3-29 14:48:37",60449502696,5,5,22,5080,6055,104,2300,94621002,230000000,4304),
("2011-3-29 22:17:35",4307438554,5,5,12,11360,11533,78,42,6954105,34000000,4126),
("2011-3-29 9:16:55",86421393336,5,5,13,5326,5237,90,70,71029148,82000000,4226),
("2011-3-29 23:57:56",4307247342,5,5,12,5064,8705,84,52,2924052,56000000,4127),
("2011-3-29 7:51:9",4307438554,5,5,12,11547,11670,78,42,5763594,34000000,4126),
("2011-3-29 22:56:13",69080810480,5,5,26,2167,1088,126,4332,1242395430,1470000000,4383),
("2011-3-29 3:51:28",4307247342,5,5,12,5064,8812,84,52,1088456,56000000,4127),
("2011-3-29 22:50:40",69080810480,5,5,26,2251,1117,126,4332,1241592621,1470000000,4383),
("2011-3-29 11:42:55",56147847144,5,5,14,3331,1277,78,500,24827096,34000000,4228),
("2011-3-29 17:15:44",47507720342,5,5,12,12243,3450,86,63,51651660,64000000,4132),
("2011-3-29 14:43:26",4295032890,5,5,13,5480,3348,88,60,58418940,72000000,4226),
("2011-3-29 17:41:5",86421378305,5,5,14,1485,2941,92,70,20697541,94000000,4225),
("2011-3-29 13:48:50",47507717618,5,5,12,12136,3356,86,63,52927422,64000000,4132),
("2011-3-29 17:31:3",86421378305,5,5,14,1076,3019,92,82,20681303,94000000,4225),
("2011-3-29 21:27:21",99374730180,5,5,26,5829,2538,127,3932,1284453278,1590000000,4383),
("2011-3-29 20:6:37",4295013659,5,5,13,4920,3796,88,70,68598067,72000000,4226),
("2011-3-29 22:35:57",86421378305,5,5,14,1252,2968,92,414,21210040,94000000,4225),
("2011-3-29 11:50:39",108062031492,5,5,17,8798,3137,93,300,31264527,100000000,4235),
("2011-3-29 8:38:39",4295032890,5,5,13,4997,3523,88,70,57863817,72000000,4226),
("2011-3-29 18:37:55",86422143767,5,5,13,4986,4895,90,60,56839521,82000000,4226),
("2011-3-29 3:4:22",17237246542,5,5,308,1040,1077,114,3230,262705176,580000000,4377),
("2011-3-29 13:2:20",4295019008,5,5,13,4684,3438,88,60,46498406,72000000,4226),
("2011-3-29 2:9:50",99374730180,5,5,26,5136,2220,127,3932,1275949796,1590000000,4383),
("2011-3-29 9:16:58",47507720342,5,5,12,12394,3365,86,63,50558914,64000000,4132),
("2011-3-29 15:17:28",4295267863,5,5,12,10491,879,88,63,22698116,72000000,4132),
("2011-3-29 20:51:42",103726644678,5,5,13,5599,5033,90,60,27045128,82000000,4226),
("2011-3-29 0:20:2",4307437863,5,5,12,11704,11518,83,42,13933708,52000000,4126),
("2011-3-29 9:24:49",86421393336,5,5,13,5800,5396,90,87,71042135,82000000,4226),
("2011-3-29 6:54:7",4307249738,5,5,12,5064,8652,83,52,23891086,52000000,4138),
("2011-3-29 3:1:50",86421393931,5,5,13,5336,5496,90,70,61775766,82000000,4226),
("2011-3-29 0:3:46",47504635734,5,5,13,9136,3377,88,62,64719617,72000000,4227),
("2011-3-29 14:15:49",51815203938,5,5,24,4746,5276,119,1769,562078656,830000000,4336),
("2011-3-29 19:35:40",4307248544,5,5,12,4981,8897,83,52,37743769,52000000,4138),
("2011-3-29 23:56:47",56128945985,5,5,19,8812,2238,91,474,52555963,88000000,4271),
("2011-3-29 10:33:15",56139983951,5,5,18,5133,4127,83,656,45015586,52000000,4236),
("2011-3-29 19:27:24",4307345229,5,5,12,11709,11737,83,52,13743393,52000000,4126),
("2011-3-29 9:45:11",4307247342,5,5,12,4861,8870,84,52,1557830,56000000,4127),
("2011-3-29 14:34:50",47504626603,5,5,14,3189,3743,91,70,52393055,88000000,4225),
("2011-3-29 0:33:20",112368188870,5,5,352,4229,1848,126,4129,498408392,1470000000,4435),
("2011-3-29 9:40:53",4307345229,5,5,12,11725,11267,83,42,12929404,52000000,4126),
("2011-3-29 17:39:9",17237246542,5,5,23,6262,7858,114,2860,287169730,580000000,4333),
("2011-3-29 14:51:37",99374730180,5,5,26,5241,2362,127,3932,1278688966,1590000000,4383),
("2011-3-29 16:11:44",4295267863,5,5,12,10894,877,88,63,22800654,72000000,4132),
("2011-3-29 8:31:38",47504628791,5,5,13,8181,3229,91,62,34983481,88000000,4227),
("2011-3-29 19:11:0",108067999319,5,5,13,11367,4353,90,62,37290280,82000000,4227),
("2011-3-29 9:45:13",108063303476,5,5,13,11209,4119,91,62,87407924,88000000,4227),
insert into itemrecord_5(Time,PlayerA,Type,ScriptID,MapA,MapAx,MapAy,PlayerLevel,GetExp,PlayerExp,PlayerMaxExp,NpcTypeID) values
("2011-3-29 17:54:40",8631790509,5,5,352,1028,1127,125,6194,1181892640,1350000000,4435),
("2011-3-29 15:2:54",47507717618,5,5,12,12312,3228,86,63,53101780,64000000,4140),
("2011-3-29 14:48:37",60449502696,5,5,22,5080,6055,104,2300,94621002,230000000,4304),
("2011-3-29 22:17:35",4307438554,5,5,12,11360,11533,78,42,6954105,34000000,4126),
("2011-3-29 9:16:55",86421393336,5,5,13,5326,5237,90,70,71029148,82000000,4226),
("2011-3-29 23:57:56",4307247342,5,5,12,5064,8705,84,52,2924052,56000000,4127),
("2011-3-29 7:51:9",4307438554,5,5,12,11547,11670,78,42,5763594,34000000,4126),
("2011-3-29 22:56:13",69080810480,5,5,26,2167,1088,126,4332,1242395430,1470000000,4383),
("2011-3-29 3:51:28",4307247342,5,5,12,5064,8812,84,52,1088456,56000000,4127),
("2011-3-29 22:50:40",69080810480,5,5,26,2251,1117,126,4332,1241592621,1470000000,4383),
("2011-3-29 11:42:55",56147847144,5,5,14,3331,1277,78,500,24827096,34000000,4228),
("2011-3-29 17:15:44",47507720342,5,5,12,12243,3450,86,63,51651660,64000000,4132),
("2011-3-29 14:43:26",4295032890,5,5,13,5480,3348,88,60,58418940,72000000,4226),
("2011-3-29 17:41:5",86421378305,5,5,14,1485,2941,92,70,20697541,94000000,4225),
("2011-3-29 13:48:50",47507717618,5,5,12,12136,3356,86,63,52927422,64000000,4132),
("2011-3-29 17:31:3",86421378305,5,5,14,1076,3019,92,82,20681303,94000000,4225),
("2011-3-29 21:27:21",99374730180,5,5,26,5829,2538,127,3932,1284453278,1590000000,4383),
("2011-3-29 20:6:37",4295013659,5,5,13,4920,3796,88,70,68598067,72000000,4226),
("2011-3-29 22:35:57",86421378305,5,5,14,1252,2968,92,414,21210040,94000000,4225),
("2011-3-29 11:50:39",108062031492,5,5,17,8798,3137,93,300,31264527,100000000,4235),
("2011-3-29 8:38:39",4295032890,5,5,13,4997,3523,88,70,57863817,72000000,4226),
("2011-3-29 18:37:55",86422143767,5,5,13,4986,4895,90,60,56839521,82000000,4226),
("2011-3-29 3:4:22",17237246542,5,5,308,1040,1077,114,3230,262705176,580000000,4377),
("2011-3-29 13:2:20",4295019008,5,5,13,4684,3438,88,60,46498406,72000000,4226),
("2011-3-29 2:9:50",99374730180,5,5,26,5136,2220,127,3932,1275949796,1590000000,4383),
("2011-3-29 9:16:58",47507720342,5,5,12,12394,3365,86,63,50558914,64000000,4132),
("2011-3-29 15:17:28",4295267863,5,5,12,10491,879,88,63,22698116,72000000,4132),
("2011-3-29 20:51:42",103726644678,5,5,13,5599,5033,90,60,27045128,82000000,4226),
("2011-3-29 0:20:2",4307437863,5,5,12,11704,11518,83,42,13933708,52000000,4126),
("2011-3-29 9:24:49",86421393336,5,5,13,5800,5396,90,87,71042135,82000000,4226),
("2011-3-29 6:54:7",4307249738,5,5,12,5064,8652,83,52,23891086,52000000,4138),
("2011-3-29 3:1:50",86421393931,5,5,13,5336,5496,90,70,61775766,82000000,4226),
("2011-3-29 0:3:46",47504635734,5,5,13,9136,3377,88,62,64719617,72000000,4227),
("2011-3-29 14:15:49",51815203938,5,5,24,4746,5276,119,1769,562078656,830000000,4336),
("2011-3-29 19:35:40",4307248544,5,5,12,4981,8897,83,52,37743769,52000000,4138),
("2011-3-29 23:56:47",56128945985,5,5,19,8812,2238,91,474,52555963,88000000,4271),
("2011-3-29 10:33:15",56139983951,5,5,18,5133,4127,83,656,45015586,52000000,4236),
("2011-3-29 19:27:24",4307345229,5,5,12,11709,11737,83,52,13743393,52000000,4126),
("2011-3-29 9:45:11",4307247342,5,5,12,4861,8870,84,52,1557830,56000000,4127),
("2011-3-29 14:34:50",47504626603,5,5,14,3189,3743,91,70,52393055,88000000,4225),
("2011-3-29 0:33:20",112368188870,5,5,352,4229,1848,126,4129,498408392,1470000000,4435),
("2011-3-29 9:40:53",4307345229,5,5,12,11725,11267,83,42,12929404,52000000,4126),
("2011-3-29 17:39:9",17237246542,5,5,23,6262,7858,114,2860,287169730,580000000,4333),
("2011-3-29 14:51:37",99374730180,5,5,26,5241,2362,127,3932,1278688966,1590000000,4383),
("2011-3-29 16:11:44",4295267863,5,5,12,10894,877,88,63,22800654,72000000,4132),
("2011-3-29 8:31:38",47504628791,5,5,13,8181,3229,91,62,34983481,88000000,4227),
("2011-3-29 19:11:0",108067999319,5,5,13,11367,4353,90,62,37290280,82000000,4227),
("2011-3-29 9:45:13",108063303476,5,5,13,11209,4119,91,62,87407924,88000000,4227),
#12
sql文件应该是没有问题的,我是用批处理生成的这个sql文件,文件小的时候是可以导进去的,几十M的都可以导进去,不知道这个一百多M就导不进去了,一直停在那里没动
#13
gamerecord-chn1030我是导入这个数据库
| 6 | root | localhost:2290 | gamerecord-chn1030 | Sleep |……
是这个进程
#14
说明一个语句都没有提交。 最大的可能是你的文件中的语句没有结束。 比如 引号的不匹配等等原因。 你不能指望我能猜出准确的问题。
建议你打开这个SQL文件后,一句一句直接贴到MYSQL中执行,然后就可以看到什么问题了。
use gamerecord-chn1030;
这句本身就有问题,你自己试一下。
#15
sql文件中的语句是绝对没有问题的,语句已经结束了,我把文件的后半部分删除,只留前半部分,大概有六十多M是可以插入进去的,这插入数据的过程是不是先要把文件读到内存中然后再插入呢?应该是某个设置给限制了读不了那么大的问题,我个人认为!
#16
应该不是啊,这个不是MYSQL中控制的,这个是操作系统来实现的。操作系统 把<xxxx 中的文件内容读出然后原样传递给前面的程序。
这样,你可以打开MYSQL的一般通用日志,然后可以看到 MYSQL中到底有没有执行提交的语句。
这样,你可以打开MYSQL的一般通用日志,然后可以看到 MYSQL中到底有没有执行提交的语句。
#17
一般通用日志??在哪里查?
#18
CREATE TABLE `itemrecord_5` (
`Id` int(11) NOT NULL auto_increment,
`Time` datetime NOT NULL default '1900-01-01 00:00:00',
`PlayerA` bigint(20) NOT NULL default '0',
`Type` int(1) NOT NULL default '0',
`ScriptID` int(11) default NULL,
`MapA` int(11) default NULL,
`MapAx` int(11) default NULL,
`MapAy` int(11) default NULL,
`PlayerLevel` int(11) default NULL,
`GetExp` bigint(20) default NULL,
`PlayerExp` bigint(20) default NULL,
`PlayerMaxExp` bigint(20) default NULL,
`NpcTypeID` int(11) default NULL,
PRIMARY KEY (`Id`)
) ENGINE=MyISAM AUTO_INCREMENT=143035528 DEFAULT CHARSET=utf8;
这是表的格式,你可以建一个把我上面发上来的内容复制到一百M试试
`Id` int(11) NOT NULL auto_increment,
`Time` datetime NOT NULL default '1900-01-01 00:00:00',
`PlayerA` bigint(20) NOT NULL default '0',
`Type` int(1) NOT NULL default '0',
`ScriptID` int(11) default NULL,
`MapA` int(11) default NULL,
`MapAx` int(11) default NULL,
`MapAy` int(11) default NULL,
`PlayerLevel` int(11) default NULL,
`GetExp` bigint(20) default NULL,
`PlayerExp` bigint(20) default NULL,
`PlayerMaxExp` bigint(20) default NULL,
`NpcTypeID` int(11) default NULL,
PRIMARY KEY (`Id`)
) ENGINE=MyISAM AUTO_INCREMENT=143035528 DEFAULT CHARSET=utf8;
这是表的格式,你可以建一个把我上面发上来的内容复制到一百M试试
#19
#20
大哥哥呀,400M 来~ 用一般的文本编辑器打开都是问题,更何况一条一条的看,看的楼主两眼冒金花
我的建议是,在快下班的时候,关闭数据库其它链接,重新执行,第二天来了再看结果
要么超时报错,要么成功!
执行了一段时间在数据库里面看不到,可能是因为数据库使用了缓存机制吧!毕竟400M不是个小数字,多等等
#21
分批导,应该。sql文件的问题,因为小文件可以嘛
#22
我已经执行完成了 在日志文件里面看到error日志提示是这样的
110415 9:45:36 [ERROR] E:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Out of memory (Needed 1992016 bytes)
110415 9:45:36 [ERROR] Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
#23
所以看来原因很简单啊,是内存不足
#24
内存不足,那要咋整,配置文件可以设置的吗?
#25
你的SQL是不是
INSERT INTO tab (....)
VALUES
(line1....),
(line2....),
(line3....),
......
(line9999999....);
啊,建议分成每100个一句insert
INSERT INTO tab (....)
VALUES
(line1....),
(line2....),
(line3....),
......
(line9999999....);
啊,建议分成每100个一句insert
#26
分成若干个文件吧,怎么分你根据实际情况而定
比如你在生成的时候,多加些条件,比如满足A条件的生成一个文件,满足B的再生成一个文件....
#27
你是用MSYQLDUMP全备的吧,这样备份是没办法的。
就1个SQL写入数据数据,当然大了
就1个SQL写入数据数据,当然大了
#28
#29
对的,我就是这样插入数据的,下面数据太多了 每一百行写一个insert?这样就可以?
#30
换个大内存机子,或者多添加几个虚拟内存文件。
用64位os+64位mysql导入,然后再把表文件复制出来。
把你的sql文件压缩了,也就30多M,传给我们这些dba,让他们用公司服务器帮你干活~~也就几分钟。
全都是最简单直接能解决问题的方案啊~~~
用64位os+64位mysql导入,然后再把表文件复制出来。
把你的sql文件压缩了,也就30多M,传给我们这些dba,让他们用公司服务器帮你干活~~也就几分钟。
全都是最简单直接能解决问题的方案啊~~~
#31
我自己就是管服务器的,我要做的是一个自动导日志的脚本,我是在xp本机上测试报内存不足,我拿到服务器上试mysql服务会自动停止?不知道原因
#32
你xp和服务器硬件啥配置啊?
你是说若干条数据库语句累死了mysql? 请放出sql文件下载地址,其中要含建表语句,估计有人感兴趣~~
你是说若干条数据库语句累死了mysql? 请放出sql文件下载地址,其中要含建表语句,估计有人感兴趣~~
#33
一条Insert语句默认是一个隐式事务。你写成一条SQL语句,要等所有的数据Load到数据库事务再提交。建议你,写成多条Insert 语句(我相信后面的值不是手动输入的吧,几百MB,手动输入,累死个人哦)。
#34
弱弱的问一下,为什么现在还没有人发明:直接把.SQL文件转换成.MYD文件的呢?
#35
进数据数据库
use databasename;
set names 'xxx' ; //你文件的编码
source /xxx/xx.sql;
我的2G多,都没有问题!
有问题会给你提示消息
use databasename;
set names 'xxx' ; //你文件的编码
source /xxx/xx.sql;
我的2G多,都没有问题!
有问题会给你提示消息
#36
后面的当然不是手动输入的撒,这么多要我一个一个输那我可以去死了,我是用脚本自动生成的,问题就是后面数据太大,每次试验吧要等很久最后还没导进去,郁闷死我了!
#37
我是用脚本导入,脚本用不了mysql命令,只能用mysql命令导入sql文件
#38
有什么不同吗?
我上面的是直接中登录mysql后在命令行的
你也可以写在程序代码中
php
mysql_query('xxxx');
mysql_query('ssxxxx');
一样执行
#39
我用的是批处理,冒似好像不行吧!
#40
批处理用source这命令怎么用?
我现在用的就是用mysql -uroot -p123456<***\***.sql
我用批处理只会这么导,还有没有别的更好的办法,
#41
你400M是一句SQL,程序需要一口气全部读入内存,并解析,开销太大,所以分成100行一个INSERT。
这就好比你搬家,你现在的家当太多,如果一次性搬的话,你需要一个集装箱,可是你的小区根本进不了那么大的车子,而且你的财力也只够雇个2吨的小卡车,那你只能分批一批批来