1

I know this is kinda stupid thing but I had some issues in my mysql database, I fixed them but when I had to delete some folders I executed a command to delete this folder /etc/mysql I have a lot of important databases which disallows me to reinstall MySQL. Is there anything like any command that allows me to recover these files? Everything was in default format so I don't really care about like the old format. If so please reply to this topic with answer or even send me a .zip file contains all files with default format for the latest MySQL version (5.7).

Thanks. I use ubuntu 16.04 by the way.

EDIT: after processing what is showing here as someone linked this topic in comments here So now I have an issue with MySQL itself. Here's the Error message:

Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sat 2019-12-21 16:59:38 EST; 5ms ago
  Process: 3942 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 3941 ExecStart=/usr/sbin/mysqld (code=exited, status=2)
  Process: 3933 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 3941 (code=exited, status=2)

Dec 21 16:59:38 ns529730 systemd[1]: Failed to start MySQL Community Server.
Dec 21 16:59:38 ns529730 systemd[1]: mysql.service: Unit entered failed state.
Dec 21 16:59:38 ns529730 systemd[1]: mysql.service: Failed with result 'exit-code'.
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)
vidarlo
  • 22,691
  • A good lesson about keeping backups. Someday, for whatever reason, you will lose all your data, too. That day you will be very happy that you maintained backups. – user535733 Dec 21 '19 at 21:21
  • 1
    Does this answer your question? How can I restore configuration files? Note that reinstalling MySQL will not touch your databases, which live in /var/lib/mysql by default. You should anyway make a backup of that directory, before you mess with your configuration. – vidarlo Dec 21 '19 at 21:43
  • @user535733 I should update them and copy them manually or there's a folder that keeps them backed up? – JustAbod Dec 21 '19 at 21:55
  • @vidarlo New error showed after doing that is showing in the link you send after doing the process for recovering a directory, I'll post it in the topic above as an edit. – JustAbod Dec 21 '19 at 22:01
  • Any staff please, if the new issue requires a new topic to be made mention me by saying to create a new topic for it as I see that the directory error has been fixed. Thanks. – JustAbod Dec 21 '19 at 22:06
  • @JustAbod Feel free to make a new question about it :) – vidarlo Dec 21 '19 at 22:07
  • New topic for new issue. https://askubuntu.com/questions/1197764/failed-to-start-mysql-community-server-5-7 – JustAbod Dec 21 '19 at 22:13

0 Answers0