Skip to content

Commit

Permalink
finalized all files by securing password entry using getpass
Browse files Browse the repository at this point in the history
  • Loading branch information
Piwoksn committed Sep 19, 2024
1 parent 5cf6e91 commit 9063412
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion database_connect.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import mysql.connector as mysql
from getpass import getpass

db = mysql.connect(
host="localhost",
user="root",
passwd=input("Please Enter Password: "),
passwd=getpass("Please Enter Password: "),
database="mccoy", # Use 'database' instead of 'db'
)

Expand Down
3 changes: 2 additions & 1 deletion deleting_from_mysql.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import mysql.connector as mysql
from getpass import getpass

db = mysql.connect(
host = "localhost",
user = "root",
passwd = input("Enter Password: "),
passwd = getpass("Enter Password: "),
db = "mccoy"
)

Expand Down
3 changes: 2 additions & 1 deletion fetching_data_from_db.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import mysql.connector as mysql
from getpass import getpass

db = mysql.connect(
host = "localhost",
user = "root",
passwd = input("Enter Password: "),
passwd = getpass("Enter Password: "),
db = "mccoy",
)

Expand Down
3 changes: 2 additions & 1 deletion modifying_or_updating_db.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import mysql.connector as mysql
from getpass import getpass

db = mysql.connect(
host = "localhost",
user = "root",
passwd = input("Enter Password: "),
passwd = getpass("Enter Password: "),
db = "mccoy",
)

Expand Down

0 comments on commit 9063412

Please sign in to comment.