php - How to fetch & store over 100k records to DB from another DB -


i have school database having more 80 000 records , want update , insert newschool database using php, whenever try run query update or insert 2 000 records , after time stopped automatically please help

you (should) full dump , import dump later. i'm not sure how php - , think you'd better doing commands on cli:

mysqldump -u <username> -p -a -r -e --triggers --single-transaction > backup.sql 

and on localhost:

mysql -u <username> -p < backup.sql  

the backup statement flags meanings from docs:

-u  

db_username

-p 

db_password

don't paste password here, enter after mysql asks it. using password on command line interface can insecure.

-a  

dump tables in databases. same using --databases option , naming databases on command line.

-e 

include event scheduler events dumped databases in output. option requires event privileges databases.

the output generated using --events contains create event statements create events. however, these statements not include attributes such event creation , modification timestamps, when events reloaded, created timestamps equal reload time.

if require events created original timestamp attributes, not use --events. instead, dump , reload contents of mysql.event table directly, using mysql account has appropriate privileges mysql database.

-r 

include stored routines (procedures , functions) dumped databases in output. use of option requires select privilege mysql.proc table.

the output generated using --routines contains create procedure , create function statements create routines. however, these statements not include attributes such routine creation , modification timestamps, when routines reloaded, created timestamps equal reload time.

if require routines created original timestamp attributes, not use --routines. instead, dump , reload contents of mysql.proc table directly, using mysql account has appropriate privileges mysql database.

--single-transaction 

this option sets transaction isolation mode repeatable read , sends start transaction sql statement server before dumping data. useful transactional tables such innodb, because dumps consistent state of database @ time when start transaction issued without blocking applications.

if need data , don't need routines nor events, skip flags.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -