将大的(并且损坏的?)纯文本文件导入 mysql 破坏了我的 lamp 安装
我正在将数据从 txt 文件导入 mysql(通过 php 脚本)。 这个转储很大,分为 10 个文件。 我导入了第一个和第二个,一切正常 - 我可以看到 phpmyadmin 等中的所有条目。大约有 700 000(?) 个条目。 当我开始导入第三个时,发生了一些奇怪的事情 - 导入脚本永远加载。 我让它完成它的工作,但是经过很长一段时间(并且由于文件与之前的文件大小相同,我认为它不应该花这么长时间),我在浏览器中单击“停止”来停止我的脚本。 然后,我尝试访问 phpmyadmin...永远加载并且永不停止。 试图加载我的网站(它在我本地的 apache2 上)...永远加载。
/etc/init.d/mysql restart
Stopping MySQL database server: mysqld
...也需要永远并且永远不会完成。 它永远不会真正阻止它。 不过,我能够成功重新启动 apache。
我确实有备份(快照 - 它是虚拟机),但我正在尝试弄清楚发生了什么。 为什么整个apache会这样反应? 发生了什么? 我该如何防止下次再发生这种情况? 我可以恢复到快照,导入有效的片段 1 和 2。 2 然后尝试第 4 个...但是如果第 4 个也破坏了一切怎么办?
我正在使用 Debian Lenny、Apache 2,我通过 /etc/hosts 和 apache 配置文件中配置的“虚拟”域访问我的网站(是的,我也尝试通过 127.0.0.1 访问它......不起作用任何一个)。
我试过这个:
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!
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).
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里可能会发生几件事。 通过以下内容找到更多线索 -
另外,killall 并不是关闭 mysql 的好方法。 尝试“sudo /etc/init.d/mysqld stop”或“mysqladmin -uroot shutdown”。 一般来说,尽量不要使用killall。 如果必须杀死,请尝试“kill [mysql's pid]”或“ps -ef|grep mysql|awk '{print $2}'|xargs Kill”
There could be several things happening here. Find some more clues with the following-
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"