Skip to content

Commit

Permalink
Update 11-tradeoffs.md
Browse files Browse the repository at this point in the history
  • Loading branch information
salacika authored Oct 17, 2024
1 parent 739d06d commit 69b1ad3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions _episodes/11-tradeoffs.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,40 @@ Getting insights in AWS cloud, has to major goals:
* A data system in cloud enables collaboration during the execution of your term project
* Introducing cloud in practice, helps students to understand the next lecture

## Access MYSQL from Python

#### Select a database
```
from mysql.connector import (connection)
connection = connection.MySQLConnection(
user='zeppelin',
password='ceudsd666',
host='localhost',
database='birdstrikes',
auth_plugin = 'mysql_native_password')
db = connection.cursor()
```
{: .language-python}

#### Run a SQL query and display resultset
```
db.execute("SELECT * FROM birdstrikes LIMIT 5;")
result = db.fetchall()
for x in result:
print(x)
```
{: .language-python}


#### Close connection
```
connection.close()
```
{: .language-python}


<br/><br/>
Expand Down

0 comments on commit 69b1ad3

Please sign in to comment.