views:

191

answers:

2

I was importing data from txt files into mysql (via php script). This dump is huge, it's splitted into 10 files. I imported first and second one and everything was ok - I could see all entries in phpmyadmin, etc. There were about 700 000(?) of entries. When i started to import third one something weird happened - import script loaded forever. I left it to complete its job but after veeeeery long time (and since file was the same size like previous pieces i thought it shouldn't take so long) i clicked 'stop' in browser to stop my script. Then, I tried to access phpmyadmin... loads forever and never stops. Tried to load my site (it's on my local apache2)... loads forever.

/etc/init.d/mysql restart
Stopping MySQL database server: mysqld

...also takes forever and never completes. It never actually stops it. I'm able to successfully restart apache, though.

I do have backup (snapshot - it's vm), but I'm trying to figure out what's happening. Why whole apache reacts this way? What happened? How do I prevent it from happening next time? I can revert to snapshot, import valid pieces 1 & 2 and then try 4th one... but what if 4th will break everything too?

I'm using Debian Lenny, Apache 2 and i'm accessing my site via 'virtual' domain configured in /etc/hosts and apache config file (yes, i tried accessing it via 127.0.0.1 too... doesn't work either).

A: 

Sorry for posting it as answer, but for some reason after i registered (i posted this question from guest account) i can't comment on my question anymore.

I tried this:

killall mysqld
debian# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld failed!
/etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full! failed!
since it shows that var is too full... how do i free it up now? i deleted some data on host machine, but i'm not sure how to make guest vm notice new free space now (i'm using virtualbox, automatically expanding storage) or how to clean it up so mysql would start. any ideas?
stran: yes, it seems that var is filled up, what to do with it now?
A: 

There could be several things happening here. Find some more clues with the following-

  • make sure you haven't filled your var partition. Issue 'df -h' and see if anything is 100% full.
  • check the mysql error log- likely located in /var/log/mysql.err or something similar.
  • You can always see what's going on in mysql by issuing 'mysql -uroot -e "show processlist"' You'll need to change the "-uroot" part to a valid user depending on how you have mysql setup ( "-u username -p ")

Also, killall isn't a great way to shut down mysql. Try 'sudo /etc/init.d/mysqld stop' or 'mysqladmin -uroot shutdown'. In general, try not to use killall. If you must kill, try "kill [mysql's pid]" or "ps -ef|grep mysql|awk '{print $2}'|xargs kill"

stran