Difference between revisions of "Command Snips"

From copec
Jump to: navigation, search
Line 1: Line 1:
 
== Shell ==
 
== Shell ==
 +
 
=== Date String Stamp ===
 
=== Date String Stamp ===
 
  `date '+%Y-%m-%d-%Hh%M'`
 
  `date '+%Y-%m-%d-%Hh%M'`
 +
 
== MySQL ==
 
== MySQL ==
 +
 
=== Create New Database and User ===
 
=== Create New Database and User ===
  <nowiki>
+
  <nowiki>mysql --defaults-file=/etc/mysql/debian.cnf  
mysql --defaults-file=/etc/mysql/debian.cnf  
+
 
CREATE DATABASE database_name;
 
CREATE DATABASE database_name;
 
CREATE USER 'foo'@'localhost' IDENTIFIED BY 'password';
 
CREATE USER 'foo'@'localhost' IDENTIFIED BY 'password';
 
GRANT ALL PRIVILEGES ON database_name.* TO 'foo'@'localhost';
 
GRANT ALL PRIVILEGES ON database_name.* TO 'foo'@'localhost';
FLUSH PRIVILEGES;
+
FLUSH PRIVILEGES;</nowiki>
</nowiki>
+

Revision as of 10:51, 31 March 2015

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;