Wikipedia:Database dump import problems
This page attempts to resolve problems that can occur while importing one of the downloadable database dumps into a local database.
"MySQL server has gone away"
This error message usually occurs when trying to import the page Wikipedia:Upload log archive/May 2004 (1) because it is bigger than 1 MB (more precisely: the SQL statement required to describe it is bigger than 1 MB). The (uninformative) error message occurs because this exceeds the default value for max_allowed_packet_size, one of MySQL's configuration variables.
It is harmless to increase the size of that variable to 32 MB or even more. You can do so in /etc/my.cnf under Linux, or in the winmysqladmin application under Windows (in the latter, go to the "my.ini Setup" tab and add the line set-variable=max_allowed_packet=32M).
Dealing with file size problems
If you are trying to import the database but are having problems downloading or uncompressing the tar file, you might try something along the lines of
wget -q -O- http://download.wikimedia.org/whatever | bunzip2 | mysql {some import options}
I haven't had time to try this yet. Please report back with any successes or problems. Mr. Jones 20:33, 21 Feb 2004 (UTC)
- This worked fine for me (for
{some import options}
I just put the database name). Wmahan. 21:44, 2004 May 1 (UTC)
- The (amended) suggestion did not work for me as wget does not support files > 2GB (See [1]) and MySQL tables do not (by default) support sizes > 4GB (See [2]). I'm currently trying
lynx -dump http://download.wikimedia.org/archives/en/20041126_old_table.sql.bz2 | bunzip2 | sed "s/InnoDB PACK_KEYS=1/InnoDB MAX_ROWS=50000 PACK_KEYS=1/g " | mysql wp
- Mr. Jones 17:50, 6 Dec 2004 (UTC)
Might be some stuff here too... Mr. Jones 18:04, 6 Dec 2004 (UTC)