Page 1 of 1

MySQL Ownership Incorrect

Posted: Sat Mar 26, 2016 8:55 pm
by mbsmi
A few moments ago I incorrectly ran a chown command and gave all directories and files on my server ownership to root as shown below:

Code: Select all

chown / root:root
Now none of my sites can connect to their mysql database, I would assume due to MySQL not belonging to the correct user. My question, what folder(s) do I need to reset back to the mysql user and group? Also, are there other services that I need to do this same thing we?

Thanks for your help
Michael

Re: MySQL Ownership Incorrect

Posted: Sun Mar 27, 2016 6:05 pm
by tjebbeke
What is your OS?

Re: MySQL Ownership Incorrect

Posted: Sun Mar 27, 2016 11:20 pm
by mehargags
Friend... you are screwed!
you cannot undo that because you don't know user and group ownership of each and every file and directory under "/"

You best bet is :
1. Restore from a Snapshot if your VPS has that
2. Create a New fresh Server, then restore data from a Vesta daily Backup set to it and verify it with files in your previous server.

Re: MySQL Ownership Incorrect

Posted: Tue Mar 29, 2016 2:25 pm
by skurudo
mbsmi wrote: Also, are there other services that I need to do this same thing we?
Michael, you can try to restore dirs/files ownership manyally, but this is hell of work
Take mehargags adviҁe ;-)