---
# System prepended metadata

title: IoTtalk Day 2 Lab 2 on OSX

---

# IoTtalk Day 2 Lab 2 on OSX

```
cd
python3 -m venv day2lab2
cd day2lab2
. bin/activate
pip install --upgrade pip
```

```
pip install PyMySQL
```

```
brew install mysql
mysql_secure_installation
```

Append the following content to `/usr/local/etc/my.cnf`:
```
init_connect = 'SET collation_connection = utf8_bin'
init_connect = 'SET NAMES utf8'
character-set-server = utf8
collation-server = utf8_bin
```

```
mysqld --initialize
```

## With Docker

```
docker run --name iottalk -p 3306:3306 -d mysql/mysql-server
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY '<root_password>';

SET character_set_client = utf8mb4;
SET character_set_results = utf8mb4;
SET character_set_connection = utf8mb4;

CREATE DATABASE iottalk;
CREATE USER 'mcnlab'@'%' IDENTIFIED BY 'mcnlab';
GRANT ALL PRIVILEGES ON iottalk.* TO 'mcnlab'@'%';
```

```
curl -L -k -o FarmDashboard.zip 'https://docs.google.com/uc?export=download&id=1FkNUSX981nlLHzNtYbSVOEFOECUmSfrK'
unzip FarmDashboard.zip
cd FarmDashboard
pip install -r requirements.txt

curl -L -k -o weatherSTA.zip 'https://docs.google.com/uc?export=download&id=1Q6Q6MReYNL0wANqu56nzA6jo3BLifmYq'
```