loading mysql database from dump is taking a long time
I am a new user of mySQL database. I am trying to load a database using a .sql dump file. The .sql file is of size 1GB and the loading process has been running for two days, and开发者_JS百科 hasn't completed yet. I am running SQL on a virtual Linux machine on a MacOS host.
I am hoping somebody would have already tried this out, So I would like to know if I am doing the right thing? Is this expected to be slow? How much more time could it take?
Btw, the command I used was
mysql -u root -p dblinux < dblinux.sql
Thanks orasp
my.cnf file
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
top output
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
24273 mysql 18 0 128m 29m 6084 S 0.0 2.9 0:46.88 mysqld
26157 bioinf 0 -20 11528 4960 1380 S 0.0 0.5 0:06.68 mysql
My suspicion is that your Linux VM may be thrashing to swap space.
Virtual machines are often limited in their allotted RAM. Have you checked whether it's run out? The 'top' command is useful for this.
If you're not familiar with 'top', the upper part of its screen shows general memory and CPU use statistics, which may immediately answer your problem. The worst CPU hogs will be at the head of the processes list that takes up the rest of the screen.
If you hit '?' whilst it's running, it'll show you the options to sort the process list: you may want to sort it by memory use (either virtual or hard).
精彩评论