简体   繁体   English

在没有mysqldump的情况下还原数据库时如何重新安装mysql?

[英]How can I reinstall mysql while restoring DBs without mysqldump?

I'm running MySQL v5.7.25 on Ubuntu 16.04.5. 我在Ubuntu 16.04.5上运行MySQL v5.7.25。 Recently I noticed MySQL was not responding to any connects or service restart. 最近,我注意到MySQL没有响应任何连接或服务重启。 I want to just purge the server and reinstall it but I have databases I want to retain and I can't use mysqldump to save them as sql files because I can't connect to mysql. 我只想清除服务器并重新安装它,但是我有要保留的数据库,由于无法连接mysql,因此无法使用mysqldump将其另存为sql文件。

Is ther a way to do this, restore the files in /var/lib/mysql after a purge / reinstall. 这是一种方法,请在清除/重新安装后在/ var / lib / mysql中还原文件。 I've all ready archived the contents of /var/lib/msysql in a tarball, I just want to know if it's just a simple matter of copying the backedup files into the /var/lib/mysql directory before I pull the trigger. 我已经准备好将/ var / lib / msysql的内容存档在tar包中,我只想知道在拉动触发器之前将备份文件复制到/ var / lib / mysql目录中是否是简单的问题。

don't use purge it removes everything. 不要使用purge它会删除所有内容。 instead use remove 而是使用remove

/var/lib/mysql folder stays untouched when you remove by using apt-get remove . 使用apt-get remove /var/lib/mysql文件夹时保持不变。 D d

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM