老师 我代码跟着视频一样的 却老是结果不对?

#dbUtil.py
import pymysql
class Mydb:
config={
"host":"localhost",
"user":"root",
"password":"root",
"db":"music_project",
"charset":"utf8"
}
def __init__(self):
self.connection=pymysql.connect(**Mydb.config)
self.cursor=self.connection.cursor()
def close(self):
if self.cursor:
self.cursor.close()
if self.connection:
self.connection.close()
def exeDML(self,sql,*args):
try:
count=self.cursor.execute(sql,args)
self.connection.commit()
return count
except Exception as e:
print(e)
if self.connection:
self.connection.rollback()
finally:
self.close()
def query_one(self,sql,*args):
try:
self.cursor.execute(sql,args)
self.cursor.fetchone()
except Exception as e:
print(e)
finally:
self.close()
def query_all(self,sql,*args):
try:
self.cursor.execute(sql,args)
return self.cursor.fetchall()
except Exception as e:
print(e)
finally:
self.close()
if __name__=='__main__':
dbutil=Mydb()
#play.py
from MyService import MyService
if __name__=="__main__":
uname=input("请输入用户名:")
password=input("请输入密码:")
myservice=MyService()
if myservice.login(uname,password):
print("登陆成功")
else:
print("登陆失败")
#MyService.py
from dbUtil import Mydb
class MyService:
def login(self,uname,password):
sql="select * from t_user where uname=%s and password=%s"
user=Mydb().query_one(sql,uname,password)
if user:
return True
else:
return False