I installed wubi in D: driver. Since I want to store mysql database folder in D: driver which has a lot more space than inside wubi. I copy /var/lib/mysql to /host/mysql then change the database dir in my.cnf file to the new location.

After that I use chown mysql:mysql /host/mysql, then check ls /host and ls /host/mysql, the owner of mysql and everything inside are still root:root.

Anyone has any idea how to change the owner from root:root to mysql:mysql?


You need to do this recursively. Therefore, use the -R option of chown. Use this command to change the owner of every file in that directory to mysql:mysql:

chown -R mysql:mysql /host/mysql

From the man page of chown:

-R, --recursive
      operate on files and directories recursively

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy