How to Query from MySQL Database in Python

with No Comments

Link: https://www.w3schools.com/python/python_mysql_select.asp fetch-all() import mysql.connector mydb = mysql.connector.connect (   host=”localhost”, user=”yourusername”,   password=”yourpassword”,   database=”mydatabase” ) mycursor = mydb.cursor() mycursor.execute(“SELECT * FROM customers”) myresult = mycursor.fetchall() for x in myresult:   print(x) fetchone() import mysql.connector mydb = mysql.connector.connect (   host=”localhost”, user=”yourusername”,   password=”yourpassword”,   … Read More

Python UUID

with No Comments

Generating UUID in Python: https://docs.python.org/3/library/uuid.html >>> import uuid >>> # make a UUID based on the host ID and current time >>> uuid.uuid1() UUID(‘a8098c1a-f86e-11da-bd1a-00112444be1e’) >>> # make a UUID using an MD5 hash of a namespace UUID and a name … Read More

Installing Postgres on MacOS with Brew

with No Comments

This is what I followed to install postgres: https://gist.github.com/ibraheem4/ce5ccd3e4d7a65589ce84f2a3b7c23a3 Pre-Reqs brew doctor brew update Installing brew install postgres ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents Create aliases: alias pg_start=”launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist” alias pg_stop=”launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist” This alias is only set for that terminal … Read More

Github SSH Key

with 5 Comments

Recently, I tried to clone a repository I was working on in GitHub that I had created, but I received the following error: Permission denied (publickey). fatal: Could not read from remote repository.Please make sure you have the correct access … Read More

Introduction to Networks

with No Comments

Networks How can 2 computers talk to each other?  through network most people buy a wireless router to connect  things together LAN = Local Area Network combination of router, computer systems, wireless router NIC = Network Interface Card ear and … Read More

1 2 3 4 5 6 7 8