[mysqld]
# 设置3306端口
port=3306
# 设置mysql的安装目录 ----------是你的文件路径-------------
basedir=D:\mysql-8.0.26-winx64\mysql-8.0.26-winx64
# 设置mysql数据库的数据的存放目录 ---------是你的文件路径data文件夹自行创建
#datadir=E:\mysql\mysql\data
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。
max_connect_errors=10
# 服务端使用的字符集默认为utf8mb4
character-set-server=utf8mb4
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
#mysql_native_password
default_authentication_plugin=mysql_native_password
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8mb4
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3306
default-character-set=utf8mb4
import pymysql
import wx
class MyFrame(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,'班级信息收集',size=(400,300))
#创建面板
panel = wx.Panel(self)
#创建“保存”和“查询”按钮,并绑定事件
self.bt_storage = wx.Button(panel,label="保存")
self.bt_storage.Bind(wx.EVT_BUTTON,self.OnclickStorage)
self.bt_inquire = wx.Button(panel,label ='查询')
self.bt_inquire.Bind(wx.EVT_BUTTON,self.OnclickInquire)
#创建文本,左对齐
self.title =wx.StaticText(panel,label ="保存信息请输入用户的学号班级和姓名\n\t查询请输入姓名或学号")
self.label_class =wx.StaticText(panel,label ="班级:")
self.text_class =wx.TextCtrl(panel,style =wx.TE_LEFT)
self.label_user =wx.StaticText(panel,label ="姓名:")
self.text_user =wx.TextCtrl(panel,style =wx.TE_LEFT)
self.label_number = wx.StaticText(panel,label ="学号:")
self.text_number = wx.TextCtrl(panel,style =wx.TE_LEFT)
#添加容器,容器中控件横向排列
hsizer_class =wx.BoxSizer(wx.HORIZONTAL)
hsizer_class.Add(self.label_class,proportion=0,flag=wx.ALL,border=5)
hsizer_class.Add(self.text_class,proportion=1,flag=wx.ALL,border=5)
hsizer_user = wx.BoxSizer(wx.HORIZONTAL)
hsizer_user.Add(self.label_user,proportion=0,flag=wx.ALL,border=5)
hsizer_user.Add(self.text_user,proportion=1,flag =wx.ALL,border=5)
hsizer_number =wx.BoxSizer(wx.HORIZONTAL)
hsizer_number.Add(self.label_number,proportion=0,flag=wx.ALL,border=5)
hsizer_number.Add(self.text_number,proportion=1,flag=wx.ALL,border=5)
hsizer_button =wx.BoxSizer(wx.HORIZONTAL)
hsizer_button.Add(self.bt_storage,proportion=0,flag=wx.ALIGN_CENTER,border=5)
hsizer_button.Add(self.bt_inquire,proportion=0,flag=wx.ALIGN_CENTER,border=5)
#添加容器,容器中的控件纵向排列
vsizer_all = wx.BoxSizer(wx.VERTICAL)
vsizer_all.Add(self.title,proportion=0,flag=wx.BOTTOM |wx.TOP |wx.ALIGN_CENTER,border=15)
vsizer_all.Add(hsizer_class,proportion=0,flag=wx.EXPAND |wx.LEFT |wx.RIGHT,border=45)