You’ll have to forgive me for dropping directly in to the comments instead of re-reading the original on this one. I was following the tags and got to the point about MySQL.
The issue is you ran
/ and at this point, changing the ownership of the MySQL directory isn’t going to be enough as files that need to be owned by
root and other users are now setup with ownership by a user that – best case is a
sudo user – worst case, is just a normal user (thus software that needs
root won’t function).
Your system won’t function properly in that state. Even if you do manage to get MySQL up and running, something else is very likely to go wrong and you’ll be back in the same situation with a different piece of software.
Given the numerous files and directories that were affected by
chown -R user /, your absolute best bet is going to be deploying another Droplet and building it over – then migrating your site over to it.
Note, I’m not saying rebuild from a snapshot (unless that snapshot is before you ran this command), I mean literally start from scratch so that all files and directories are properly owned by their respective users.
I know that’s not what you want to hear right now, but you’re going to spend more time trying to fix the files/directories and their ownership/permissions than you will moving the site over. There’s no way to just undo a command either, so starting from scratch is going to be your best bet.
One thing though – don’t beat yourself up over it – we all make mistakes. I’ve made my fair share in the last 16-17 years. Moving forward, I find it best to write your commands in a text editor, and then copy -> paste in to terminal. That way you’re physically looking at the command at least twice before you hit enter.