[Solved]
Ubuntu 12.10 x64 new i7 laptop, mysql default installation.
Importing a 6 MB dump file (a empty drupal dump made mostly of INSERT INTO statements) takes ~30 minutes, on other PC takes less than a minute.
I created an ext3 partition and monted /var/lib/mysql there, but it didn't solve the problem.
iostat -x :
Linux 3.5.0-27-generic (lobiancoOfficeLinux) 09/04/2013 _x86_64_ (8 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
2,44 0,01 0,49 2,44 0,00 94,62
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 34,47 68,87 9,86 31,42 388,97 420,90 39,24 1,51 36,56 37,10 36,39 9,65 39,85
What else could it be to give mysql such a slow performance ?
I don't know if it's related, but also opening the dump.sql file with gedit or kate is pretty slow..
Can you give some more details about your MySQL instance. Which version do you use? You can see the exact version when starting the mysql client. Next question, what storage engine do you use? And finally what are the settings in /etc/mysql/my.cnf? Usually with the default settings the server is not configured for serious use. You need to configure the server according to the needs of your application to have it running fast. BTW I have a similar machine i7, 8 Gb RAM, Ubuntu 12.04 LTS and it works perfectly.
As you said opening the file in gedit or kate are also slow could indicate an io bottleneck.
ext3 is not recommended for MySQL. Either use ext2 or even better XFS. ext3 is known to be slow with MySQL.