I run into a very stupid problem, trying to migrate files into new xampp server and having hard time until i realised:

The installation from package created username with space in it.

So now i have username "mysql -" and group "mysql" which control databases and i need to change ownership on 30 database and more than 300 tables in that folder, but the only way i know is manually change one by one folder of database.

How can i bulk change ownership of all folders and files via terminal or somehow if user have space in name?

  • 1
    If you problem is just escaping the space, you can do it using \ (for example, if your username is "a b" you can do chown a\ b). Wrapping it in quotes (like chown "a b") may work as well. – Salem Sep 14 '13 at 23:57

2 options come to mind:

  • Escape the space: mysql\ -
  • Use MySQL Workbench/administrator

But I would advice to change the user to one without a space in it.

  • You are both right, i thought to wrap it in quotes but that didn't worked i don't know why. But escaping worked. I don't know why installation created mysql - user with space but changing to something else would require me some more digging and probably configuration in some files. On copy files were root but it only works if files are owned by mysql - – lonerunner Sep 15 '13 at 0:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.