Import large .sql file into MySQL

后端 未结 2 772
难免孤独
难免孤独 2021-02-05 18:31

I have been given a VERY large mysql backup file. It is ~630 MB... I guess someone thought it was a good idea to store images in a database... Anyway, I need to

2条回答
  •  攒了一身酷
    2021-02-05 18:49

    Increasing the wait_timeout and/or interactive_timeout should help. First check the current value:

    C:\> mysql -hlocalhost -uroot -proot
    
    mysql> SHOW VARIABLES LIKE 'wait_timeout';
    

    If this is very low (e.g. 30 seconds) then increase it (e.g. 5 minutes):

    mysql> SET SESSION wait_timeout = 300;
    mysql> SET SESSION interactive_timeout = 300;
    

    Then execute your SQL file:

    mysql> \. database.sql
    

提交回复
热议问题