Command Snips

From copec
Revision as of 10:51, 31 March 2015 by 199.104.121.172 (Talk)

Jump to: navigation, search

Shell

Date String Stamp

`date '+%Y-%m-%d-%Hh%M'`

MySQL

Create New Database and User

mysql --defaults-file=/etc/mysql/debian.cnf 
CREATE DATABASE database_name;
CREATE USER 'foo'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database_name.* TO 'foo'@'localhost';
FLUSH PRIVILEGES;