Command Snips

From copec
Revision as of 08:41, 9 June 2015 by 75.169.177.98 (Talk)

Jump to: navigation, search

Shell

Date String Stamp

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

MySQL

Create New Database and User

For database 'new_db_name' and user 'new_user':

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

Update User Password

SET PASSWORD FOR 'username'@'%.example.com' = PASSWORD('good_password');