dump mysql db on server 1
$ mysql --version
mysql Ver 14.14 Distrib 5.1.54, for debian-linux-gnu (x86_64) using readline 6.2
$ mysqldump -u root -p db > db.sql
import on server 2
$ mysql --version
mysql Ver 14.12 Distrib 5.0.95, for unknown-linux-gnu (x86_64) using readline 5.1
$ mysql -u root -p db < db.sql
ERROR 1071 (42000) at line 807: Specified key was too long; max key length is 1000 bytes
I know there is a lot of questions and answers on this error but it still leaves me puzzled.
Can it be a version problem? I suspect no.
If I run it with --force option, it gets even wierder:
ERROR 1071 (42000) at line 807: Specified key was too long; max key length is 1000 bytes
ERROR 1146 (42S02) at line 847: Table 'db.users' doesn't exist
ERROR 1146 (42S02) at line 848: Table 'db.users' doesn't exist
ERROR 1146 (42S02) at line 849: Table 'db.users' doesn't exist
ERROR 1146 (42S02) at line 850: Table 'db.users' doesn't exist
what is going on?
I mean apart from solving this, I would like to understand what settings affect a simple dump-import act and why can those settings not be explicit in my dump file and be set t import.
I prefer not having to debug actual errors, this must be solveable on high level.
UPDATE: SOLUTION as Frederic pointed me to the right direction. Basically my dump was trying to set db with INNODB engine, but mysql on server 2 had in /etc/my.cnf
[mysqld]
skip-innodb
by simply deleting this option and restarting mysqld, my import ran without a croak. I am very sad such a simple thing like an unavailable engine is not worthy of warning or error rather than key length issue caused by silently falling back to myISAM. Hmm. So time to switch to posgresql? mongo? :)