I have a question for PyQT.

Asked 2 years ago, Updated 2 years ago, 124 views

# 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

2022-09-22 21:40

1 Answers

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.


2022-09-22 21:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.