Importing large sql file to MySql via command line

后端 未结 5 900
猫巷女王i
猫巷女王i 2020-12-22 18:08

I\'m trying to import an sql file of around 300MB to MySql via command line in Ubuntu. I used

source /var/www/myfile.sql;

Right now it\'s

5条回答
  •  -上瘾入骨i
    2020-12-22 18:46

    Guys regarding time taken for importing huge files most importantly it takes more time is because default setting of mysql is "autocommit = true", you must set that off before importing your file and then check how import works like a gem...

    First open MySQL:

    mysql -u root -p

    Then, You just need to do following :

    mysql>use your_db

    mysql>SET autocommit=0 ; source the_sql_file.sql ; COMMIT ;

提交回复
热议问题