Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Creating users

  • Loading branch information...
commit f4b9c977ae441fd8b2c3d43b548c23527da85bee 1 parent 9d26f84
@bmc authored
Showing with 73 additions and 13 deletions.
  1. +44 −3 cheat-sheets.sublime-workspace
  2. +10 −10 mysql.md
  3. +19 −0 postgresql.md
View
47 cheat-sheets.sublime-workspace
@@ -70,6 +70,14 @@
"buffer_size": 799,
"line_ending": "Unix"
}
+ },
+ {
+ "file": "linux.md",
+ "settings":
+ {
+ "buffer_size": 2993,
+ "line_ending": "Unix"
+ }
}
],
"build_system": "Build Book",
@@ -312,7 +320,7 @@
]
},
{
- "selected": 1,
+ "selected": 2,
"sheets":
[
{
@@ -354,8 +362,8 @@
"selection":
[
[
- 798,
- 798
+ 799,
+ 799
]
],
"settings":
@@ -368,6 +376,35 @@
"zoom_level": 1.0
},
"type": "text"
+ },
+ {
+ "buffer": 6,
+ "file": "linux.md",
+ "settings":
+ {
+ "buffer_size": 2993,
+ "regions":
+ {
+ },
+ "selection":
+ [
+ [
+ 1989,
+ 1989
+ ]
+ ],
+ "settings":
+ {
+ "buffer_scroll_name": "f52a034c",
+ "syntax": "Packages/Markdown/Markdown.tmLanguage",
+ "tab_size": 4,
+ "translate_tabs_to_spaces": true
+ },
+ "translation.x": 0.0,
+ "translation.y": 1125.0,
+ "zoom_level": 1.0
+ },
+ "type": "text"
}
]
}
@@ -421,6 +458,10 @@
"selected_items":
[
[
+ "li",
+ "linux.md"
+ ],
+ [
"virtual",
"virtual-box.md"
]
View
20 mysql.md
@@ -3,16 +3,6 @@ title: MySQL Cheat Sheet
layout: cheat-sheet
---
-# Grant all privileges to a database
-
-Prior to MySQL 5:
-
- GRANT ALL PRIVILEGES ON db_base.* TO db_user @'%' IDENTIFIED BY 'db_passwd';
-
-MySQL 5:
-
- GRANT ALL PRIVILEGES ON db_base.* TO db_user IDENTIFIED BY 'db_passwd';
-
# Create a database
Using default system encoding:
@@ -24,3 +14,13 @@ Specifying encoding:
$ mysql -u root
mysql> create database db_name character set utf8;
+
+# Grant all privileges to a database
+
+Prior to MySQL 5:
+
+ GRANT ALL PRIVILEGES ON db_base.* TO db_user @'%' IDENTIFIED BY 'db_passwd';
+
+MySQL 5:
+
+ GRANT ALL PRIVILEGES ON db_base.* TO db_user IDENTIFIED BY 'db_passwd';
View
19 postgresql.md
@@ -13,6 +13,25 @@ is defined in `pg_hba.conf` (`/etc/postgres/<version>`) and defaults to
* "su" to the "postgres" user
* "psql" should then work
+# Create a user
+
+Typical: User can create new databases and can log in.
+
+ $ psql
+ postgres=# create role username with password 'foo' createdb login;
+
+# Create a database
+
+Using default system encoding:
+
+ $ psql
+ postgres=# create database db_name with owner = 'user';
+
+Specifying encoding:
+
+ $ psql
+ postgres=# create database db_name with owner = 'user' encoding 'utf8';
+
# Get list of databases
SELECT datname FROM pg_database
Please sign in to comment.
Something went wrong with that request. Please try again.