MySQL files have been deleted all of a sudden





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I have an Ubuntu 14.04 instance running the LAMP stack. Everything was working fine. Yesterday all of a sudden, the server started denying access to login via root. After a couple of trials, I gained access to the system. To my realisation, dpkg directory had some issues which I fixed by manually making folders. Still the application did not start. Upon further investigation, I noticed that




MySQL - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)




was being displayed on the application home page. Going further, I found out that the entire MySQL data along with the logs had disappeared. I don't know what is wrong!! Kindly help with solutions.










share|improve this question




















  • 3





    Your MySQL data lives in /var/lib/mysql, not in /var/run/, if that helps.

    – Jos
    Mar 27 at 9:47











  • I had around 100 tables which is nowhere to be found in /var/lib/mysql. /var/run contained the socket related issue.

    – Hitesh Suvarna
    Mar 27 at 10:12











  • MySQL files are writable only by the mysql user. So if they have been deleted, it must have been by a root-level process. Stop the MySQL server, restore your data from backup, and restart the server.

    – Jos
    Mar 27 at 10:16











  • In the /var/lib/mysql folder, I can see ibdata1, ib_logfile0, ib_logfile1. How do I use that to recover data? Also do you know what is the cause of such issues?

    – Hitesh Suvarna
    Mar 27 at 10:22






  • 1





    Those are your data files. The tables are inside them, unless you have somehow reinitialized the server. Restart the server and do show databases etc.

    – Jos
    Mar 27 at 10:24


















0















I have an Ubuntu 14.04 instance running the LAMP stack. Everything was working fine. Yesterday all of a sudden, the server started denying access to login via root. After a couple of trials, I gained access to the system. To my realisation, dpkg directory had some issues which I fixed by manually making folders. Still the application did not start. Upon further investigation, I noticed that




MySQL - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)




was being displayed on the application home page. Going further, I found out that the entire MySQL data along with the logs had disappeared. I don't know what is wrong!! Kindly help with solutions.










share|improve this question




















  • 3





    Your MySQL data lives in /var/lib/mysql, not in /var/run/, if that helps.

    – Jos
    Mar 27 at 9:47











  • I had around 100 tables which is nowhere to be found in /var/lib/mysql. /var/run contained the socket related issue.

    – Hitesh Suvarna
    Mar 27 at 10:12











  • MySQL files are writable only by the mysql user. So if they have been deleted, it must have been by a root-level process. Stop the MySQL server, restore your data from backup, and restart the server.

    – Jos
    Mar 27 at 10:16











  • In the /var/lib/mysql folder, I can see ibdata1, ib_logfile0, ib_logfile1. How do I use that to recover data? Also do you know what is the cause of such issues?

    – Hitesh Suvarna
    Mar 27 at 10:22






  • 1





    Those are your data files. The tables are inside them, unless you have somehow reinitialized the server. Restart the server and do show databases etc.

    – Jos
    Mar 27 at 10:24














0












0








0








I have an Ubuntu 14.04 instance running the LAMP stack. Everything was working fine. Yesterday all of a sudden, the server started denying access to login via root. After a couple of trials, I gained access to the system. To my realisation, dpkg directory had some issues which I fixed by manually making folders. Still the application did not start. Upon further investigation, I noticed that




MySQL - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)




was being displayed on the application home page. Going further, I found out that the entire MySQL data along with the logs had disappeared. I don't know what is wrong!! Kindly help with solutions.










share|improve this question
















I have an Ubuntu 14.04 instance running the LAMP stack. Everything was working fine. Yesterday all of a sudden, the server started denying access to login via root. After a couple of trials, I gained access to the system. To my realisation, dpkg directory had some issues which I fixed by manually making folders. Still the application did not start. Upon further investigation, I noticed that




MySQL - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)




was being displayed on the application home page. Going further, I found out that the entire MySQL data along with the logs had disappeared. I don't know what is wrong!! Kindly help with solutions.







server apache2 mysql data-recovery data-loss






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 2 at 14:46









Zanna

51.4k13140243




51.4k13140243










asked Mar 27 at 9:41









Hitesh SuvarnaHitesh Suvarna

1




1








  • 3





    Your MySQL data lives in /var/lib/mysql, not in /var/run/, if that helps.

    – Jos
    Mar 27 at 9:47











  • I had around 100 tables which is nowhere to be found in /var/lib/mysql. /var/run contained the socket related issue.

    – Hitesh Suvarna
    Mar 27 at 10:12











  • MySQL files are writable only by the mysql user. So if they have been deleted, it must have been by a root-level process. Stop the MySQL server, restore your data from backup, and restart the server.

    – Jos
    Mar 27 at 10:16











  • In the /var/lib/mysql folder, I can see ibdata1, ib_logfile0, ib_logfile1. How do I use that to recover data? Also do you know what is the cause of such issues?

    – Hitesh Suvarna
    Mar 27 at 10:22






  • 1





    Those are your data files. The tables are inside them, unless you have somehow reinitialized the server. Restart the server and do show databases etc.

    – Jos
    Mar 27 at 10:24














  • 3





    Your MySQL data lives in /var/lib/mysql, not in /var/run/, if that helps.

    – Jos
    Mar 27 at 9:47











  • I had around 100 tables which is nowhere to be found in /var/lib/mysql. /var/run contained the socket related issue.

    – Hitesh Suvarna
    Mar 27 at 10:12











  • MySQL files are writable only by the mysql user. So if they have been deleted, it must have been by a root-level process. Stop the MySQL server, restore your data from backup, and restart the server.

    – Jos
    Mar 27 at 10:16











  • In the /var/lib/mysql folder, I can see ibdata1, ib_logfile0, ib_logfile1. How do I use that to recover data? Also do you know what is the cause of such issues?

    – Hitesh Suvarna
    Mar 27 at 10:22






  • 1





    Those are your data files. The tables are inside them, unless you have somehow reinitialized the server. Restart the server and do show databases etc.

    – Jos
    Mar 27 at 10:24








3




3





Your MySQL data lives in /var/lib/mysql, not in /var/run/, if that helps.

– Jos
Mar 27 at 9:47





Your MySQL data lives in /var/lib/mysql, not in /var/run/, if that helps.

– Jos
Mar 27 at 9:47













I had around 100 tables which is nowhere to be found in /var/lib/mysql. /var/run contained the socket related issue.

– Hitesh Suvarna
Mar 27 at 10:12





I had around 100 tables which is nowhere to be found in /var/lib/mysql. /var/run contained the socket related issue.

– Hitesh Suvarna
Mar 27 at 10:12













MySQL files are writable only by the mysql user. So if they have been deleted, it must have been by a root-level process. Stop the MySQL server, restore your data from backup, and restart the server.

– Jos
Mar 27 at 10:16





MySQL files are writable only by the mysql user. So if they have been deleted, it must have been by a root-level process. Stop the MySQL server, restore your data from backup, and restart the server.

– Jos
Mar 27 at 10:16













In the /var/lib/mysql folder, I can see ibdata1, ib_logfile0, ib_logfile1. How do I use that to recover data? Also do you know what is the cause of such issues?

– Hitesh Suvarna
Mar 27 at 10:22





In the /var/lib/mysql folder, I can see ibdata1, ib_logfile0, ib_logfile1. How do I use that to recover data? Also do you know what is the cause of such issues?

– Hitesh Suvarna
Mar 27 at 10:22




1




1





Those are your data files. The tables are inside them, unless you have somehow reinitialized the server. Restart the server and do show databases etc.

– Jos
Mar 27 at 10:24





Those are your data files. The tables are inside them, unless you have somehow reinitialized the server. Restart the server and do show databases etc.

– Jos
Mar 27 at 10:24










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1129076%2fmysql-files-have-been-deleted-all-of-a-sudden%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1129076%2fmysql-files-have-been-deleted-all-of-a-sudden%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

數位音樂下載

When can things happen in Etherscan, such as the picture below?

格利澤436b