# Notes On Python/Flask Ideas around python/flask labs and lectures: * Use the [flask - microblog](https://github.com/pallets/flask) as a simple example. * python 3 required. flask * docker with mysql [Docker For Mac Mysql Setup](https://dzone.com/articles/docker-for-mac-mysql-setup) ### Python 3 `brew install python` gets python3 on your mac [The Hitchhiker’s Guide to Python](http://docs.python-guide.org/en/latest/) for *fascinating* information on your new **Best Friend**, *python* (3) #### Creating and Using a Virtual Python Environment ```bash $ python3 -m venv ./PythonEnv $ source ./PythonEnv/bin/activate $ which python ``` just kill the terminal window to rid yourself of the virtual env. ### Docker once installed, and the mysql is running: ```sql $ docker exec -it mysql bash bash-4.2# mysql -uroot -ppassword mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 46 Server version: 5.7.21 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE USER 'yourusername'@'%' IDENTIFIED BY 'yourfavoritepassword'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON * . * TO 'yourusername'@'%'; Query OK, 0 rows affected (0.00 sec) mysql> quit Bye bash-4.2# exit exit ``` 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