# button
self.Login_Button = QtWidgets.QPushButton(LoginFrom)
self.Login_Button.setGeometry(QtCore.QRect(230, 220, 111, 41))
self.Login_Button.setObjectName("Login_Button")
self.Login_Button.clicked.connect(self.login)
self.retranslateUi(LoginFrom)
QtCore.QMetaObject.connectSlotsByName(LoginFrom)
def login(self):
server = self.ServerIp.text()
user = self.ID.text()
pw = self.Password.text()
db = self.Database.text()
conn = pymysql.connect(host=server, user=user, password=pw,db=db, charset='utf8')
if conn==True :
pass
else :
self.Errorlabel.setText ("Invalid information".")
Creating login form. If you log in to sql, a new dialog appears and you cannot log in I want to display the wrong information in the label window, but there is an error in the conn part, what should I do?
python pyqt
The conn part is an error because you cannot access the mysql daemon.
Use the client tool (mysql workbench, etc.) to access the connection information.
© 2024 OneMinuteCode. All rights reserved.