Page 1 of 1

restoring sql folder ?

Posted: Mon Jun 11, 2018 7:41 pm
by exxos
I have a server dump form 6 months ago, I just want to restore a single sql folder... which I can do, but the permissions get put to "root" not "mysql".. Then mysqld uses 100% CPU, assume as it can't access the folder.. so I had to delete it to get my server running again...

but I assume there's some way to restore permissions to the folder so the owner is "mysql" ?? (im using ubuntu)

Re: restoring sql folder ?

Posted: Mon Jun 11, 2018 8:06 pm
by exxos
Oh found it nevermind...

Code: Select all

sudo chown -R mysql:mysql /var/lib/mysql

Re: restoring sql folder ?

Posted: Mon Jun 11, 2018 8:07 pm
by IngoQ
If it's just the owner, you can assign the correct one by using this command:

Code: Select all

chown mysql:mysql /var/lib/mysql/db/ -R
This example would set the owner and group of the folder "/var/lib/mysql/db/" (and all files and subfolders in it) to "mysql".

You have to be root for this, so in Ubuntu I guess you should prefix it with a "sudo"

Re: restoring sql folder ?

Posted: Mon Jun 11, 2018 8:07 pm
by IngoQ
A little too slow ;)