0% found this document useful (0 votes)
14 views

Import Mysq3

The document contains code to connect to a MySQL database and create a table called login with columns for name, user_id, and passwd.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Import Mysq3

The document contains code to connect to a MySQL database and create a table called login with columns for name, user_id, and passwd.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

i

mpor
tmy
sql
.connect
orassql

conn=sql
.connect
(host
="l
ocal
host
",
user
="r
oot
",
passwd="
manager
",
dat
abase="
old"
)

i
fconn.
is_
connect
ed(
):

pr
int
('
successf
ull
yconnect
ed'
)

c1=conn.
cur
sor
()

c1.
execut
e('
creat
etabl
elogi
n(namev
archar
(50)
,user
_idv
archar
(30)
pri
mar
ykey
,passwd
var
char(
20))
')

You might also like