chenyongzhe / qt-studentmanager Goto Github PK
View Code? Open in Web Editor NEWC++ Qt 基于数据库Mysql学生信息管理系统
C++ Qt 基于数据库Mysql学生信息管理系统
按照步骤走到装入数据库了,然后qt打开作者的pro文件按编译无反应请问是什么情况呢
我现在也在用VS+QT+MySQL写一个类似的课设,但是关于QT链接MySQL操作不是很明白,想看看你的工程学习,但clone了你的工程之后因为卡在登陆界面导致不能再进一步看,所以想知道怎么删除这个登陆的部分,或是不使用账号登陆。文档中对登陆方面说的不是很清楚
我鼓捣了一晚上,还是那个问题,就是显示密码错误,然后控制台打印"QSqlQuery::exec: database not open",
我用的你给的qt和mysql的安装包,然后发现我的mysql里面只有libmysql.dll,没有libmysqld.dll,所以我只把
libmysql.dll放到qt的bin里了(不知道是不是这个原因),然后我把那几个头文件都加进去了,就是加了这些代码
QSqlDatabase data_base = QSqlDatabase::addDatabase("QMYSQL");
data_base.setHostName("126.0.0.1"); //设置主机地址
data_base.setPort(3306); //设置端口
data_base.setDatabaseName("test"); //设置数据库名称
data_base.setUserName("root"); //设置用户名
data_base.setPassword("123"); //设置密码
if(!data_base.open())
qDebug()<<"failed to connect to mysql";
else
qDebug()<<"success";
然后它每次都给我打印“failed to connect to mysql”。。。。。。。。。。。
你好,我是QT界面的新手,请问你的这个工程,是直接用QTcreator打开吗?还是需要跟VS一起使用?我使用QT打开pro文件后,不知道怎么编译运行。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.