Welcome Guest, Not a member yet? Register   Sign In
Insert 1 milion record
#12

(11-07-2017, 08:42 AM)omid_student Wrote:
(09-29-2017, 02:17 PM)ciadvantage Wrote:
(09-29-2017, 01:31 PM)omid_student Wrote:
(09-29-2017, 01:25 PM)ciadvantage Wrote: Well if ID is primary key then it should be auto-incremented as you set it, so it is taken care off already.  Your example is like
ID isnt.  I would have it as primary key then problem is solved

Ok for insert ID,my problem solved.
Now how do i insert many record?(about 1 million)

you can do from code level but it is not recommended.  I found it is easier just use this

https://dev.mysql.com/doc/refman/5.7/en/load-data.html

ie. using command from mysql > LOAD DATA INFILE 'users.txt' INTO TABLE yourdb.users;

/* Assume you have db name as yourdb and table users, your users.txt should be comma seperated */

Try a simple test file with few names to see how it goes then you can go from there.

Hey i cannot access to command line mysql
How do it?

The best way is using MySQL Tools like MySQL Workbench, Navicat, SQLyog to do the Import / Export.
Reply


Messages In This Thread
Insert 1 milion record - by omid_student - 09-29-2017, 01:15 PM
RE: Insert 1 milion record - by ciadvantage - 09-29-2017, 01:25 PM
RE: Insert 1 milion record - by omid_student - 09-29-2017, 01:31 PM
RE: Insert 1 milion record - by ciadvantage - 09-29-2017, 02:17 PM
RE: Insert 1 milion record - by omid_student - 09-30-2017, 11:17 AM
RE: Insert 1 milion record - by omid_student - 11-07-2017, 08:42 AM
RE: Insert 1 milion record - by Narf - 11-07-2017, 08:54 AM
RE: Insert 1 milion record - by omid_student - 11-07-2017, 11:53 AM
RE: Insert 1 milion record - by fenzy - 11-12-2017, 04:07 AM
RE: Insert 1 milion record - by ciadvantage - 09-30-2017, 02:20 PM
RE: Insert 1 milion record - by omid_student - 10-01-2017, 02:16 AM
RE: Insert 1 milion record - by agus - 11-12-2017, 02:11 AM
RE: Insert 1 milion record - by kilishan - 11-12-2017, 09:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB