소스 검색

MySQL notes added.

Kristofer Younger 6 년 전
부모
커밋
037830d82c
1개의 변경된 파일40개의 추가작업 그리고 0개의 파일을 삭제
  1. 40
    0
      README.md

+ 40
- 0
README.md 파일 보기

@@ -0,0 +1,40 @@
1
+# Notes On Python/Flask
2
+Ideas around python/flask labs and lectures:
3
+* Use the [flask - microblog](https://github.com/pallets/flask) as a simple example.
4
+* python 3 required. flask
5
+* docker with mysql [Docker For Mac Mysql Setup](https://dzone.com/articles/docker-for-mac-mysql-setup)
6
+
7
+
8
+### Docker
9
+
10
+once installed, and the mysql is running:
11
+```sql
12
+$ docker exec -it mysql bash
13
+
14
+bash-4.2# mysql -uroot -ppassword
15
+mysql: [Warning] Using a password on the command line interface can be insecure.
16
+Welcome to the MySQL monitor.  Commands end with ; or \g.
17
+Your MySQL connection id is 46
18
+Server version: 5.7.21 MySQL Community Server (GPL)
19
+
20
+Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
21
+
22
+Oracle is a registered trademark of Oracle Corporation and/or its
23
+affiliates. Other names may be trademarks of their respective
24
+owners.
25
+
26
+Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
27
+
28
+mysql> CREATE USER 'yourusername'@'%' IDENTIFIED BY 'yourfavoritepassword';
29
+Query OK, 0 rows affected (0.00 sec)
30
+
31
+mysql> GRANT ALL PRIVILEGES ON * . * TO 'yourusername'@'%';
32
+Query OK, 0 rows affected (0.00 sec)
33
+
34
+mysql> quit
35
+Bye
36
+bash-4.2# exit
37
+exit
38
+```
39
+
40
+Now you can use `yourusername` with a a password of `yourfavoritepassword` in the MySQLWorkbench to view, change and edit your database(s). The MySQL is at localhost:3306