Thursday, January 10, 2013

New MySQL database

New database "x" with new user "x" with password "p".

CREATE DATABASE x CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
CREATE USER 'x'@'localhost' IDENTIFIED BY 'p';
GRANT ALL ON u.* TO 'x'@'localhost';

Use collation specific to your language, e.g. "utf8_czech_ci" if you want better sorting accuracy.

File permissions with ACL


Default group privileges for new files and directories:

setfacl -R -d -m g::rwX <path>

Don't forget to do chmod g+s to set setuid bit so that file objects inherit group.