1

Does mysql has a limit on how many records it can insert into a table?

I'm pulling records from an Oracle DB/Staff Table to a MySql Datbase/Staff Table by running a php script. The total records in the Oracle DB/Staff Table = 3602 after the script runs it only inserted 3319 records into the MySql/Staff Table.

O. Jones
  • 103,626
  • 17
  • 118
  • 172
kareem
  • 21
  • 3
  • 1
    Any warnings or errors? MySQL tables are limited by the filesystem, but 3319 records is nothing! – eggyal Jul 23 '12 at 14:21
  • have you checked your max_execution_time for php? see: http://www.php.net/manual/en/info.configuration.php – donald123 Jul 23 '12 at 14:22
  • Also, check [max_allowed_packet](https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html). – Marcus Adams Jul 23 '12 at 14:27
  • 1
    could you provide your code and some database schema? – Danny Calladine Jul 23 '12 at 14:24
  • No warning or errors and I also set the max execution time in the php.ini from the default to 300= 5mins – kareem Jul 23 '12 at 14:30
  • create table staff_gymmembers_2012_2013 ( staff_id int(8) PRIMARY KEY NOT NULL, first_name varchar(65) NOT NULL, last_name varchar(65) NOT NULL, department varchar(255) NOT NULL, job_title varchar(255) NOT NULL )ENGINE=InnoDB MAX_ROWS=5000; – kareem Jul 23 '12 at 14:38
  • possible duplicate of [MySQL - how many rows can I insert in one single INSERT statement?](http://stackoverflow.com/questions/3536103/mysql-how-many-rows-can-i-insert-in-one-single-insert-statement) – Mat Jul 24 '12 at 05:07

2 Answers2

2

It is possible that your table have some constraints like PRIMARY KEY or UNIQUE KEY which is causing some inserts to fail.

Check for warnings using following query after you execute INSERT as:

SHOW WARNINGS;

You can specify MAX_ROWS while creating a table.

Omesh
  • 27,801
  • 6
  • 42
  • 51
0

Check the 3320th row data in Oracle. If it is not compatible with MySQL because of special character the error may occur.

Bart
  • 19,692
  • 7
  • 68
  • 77
user9371102
  • 1,278
  • 3
  • 21
  • 43