Failed Attempt 1
I was trying to import a huge SQL file (with 600 millions records & 239 GB) into a MySQL database with a different schema, in order to get a new column with an "auto-generated ID."
I'm using MySQL Workbench 6.2 on Windows, but it always failed with the error message "MySQL server has gone away" after importing tens of millions of records.
I was using "Server -> Data Import" feature to do the import.
I tried to add
wait_timeout = 288000
max_allowed_packet = 300G
into my.ini
inside the folder of MySQL Server, but the same error occurred.
The error log is as follows:
14:16:37 Restoring C:\data.sql
Running: mysql.exe --defaults-file="c:\users\***\appdata\local\temp\5\tmpcfyyxk.cnf" --protocol=tcp --host=127.0.0.1 --user=shodan --port=8080 --default-character-set=utf8 --comments --database=test2 < "C:\\data.sql"
ERROR 2006 (HY000) at line 13776162: MySQL server has gone away
Operation failed with exitcode 1
16:25:51 Import of C:\data.sql has finished with 1 errors
Failed Attempt 2
If I instead just add a new column in the original table, it just takes too long to execute the SQL query and never succeeds.
If the import issue cannot be solved, is there any way to directly add a new column with auto-generated ID into the huge table?