Does Qt6 cancel MySQL support by default?

Explanation: This article is not about how qt uses MySQL. There are a lot of articles like this.

1. Conclusion

Qt6 has indeed canceled the support for MySQL by default, and users need to compile and generate the MySQL driver DLL library by themselves.

First of all, it is not that qt has increased the use threshold because the wind direction has changed, but since Oracle acquired MySQL and commercialized it, MySQL is no longer a completely open source database, and Qt officials have always strictly adhered to the open source concept, so Qt6 removed default support for MSOL databases.

What happened to MySQL?

M ySQL is still the most popular open source database, but it has been losing fans over the years, including many big companies.

MySQL got off to a good start, but the troubles started when it was acquired by Sun Microsystems in 2008. Top developers expressed their misgivings about Sun Microsystem's entire acquisition and intentions. Later, Oracle's acquisition of Sun Microsystem aroused a lot of criticism from the open source community, which became the last straw that broke the camel's back.

MySQL exploded in popularity back in 2008 when Sun Microsystems acquired MySQL AB for approximately $1 billion. The following year, Oracle bought Sun, and MySQL was part of the deal . MySQL users and developers are starting to question the fate of the open source database, and many of them are looking for alternatives.

After the acquisition, MySQL's top developers created forks of MySQL. This fork later became known as MariaDB and was officially made available to the open source community in 2009 under the GNU license. Since then, MariaDB has revolutionized the open source database landscape and continues to grow by leaps and bounds. Due to MySQL's licensing, more companies continue to migrate to MariaDB because it has the same plethora of new features and improvements as MySQL.

Despite this, MySQL's popularity continues to decline. The reasons are as follows:

1. MySQL is open source...but only a little open source, not pure open source

Technically, MySQL is an open source database, but in practice, it doesn't look like it anymore. Under the Oracle umbrella, MySQL now has proprietary closed-source modules. "MySQL still exists on paper, but Oracle's delay in development and refusal to release MySQL's test cases for bugs and security patches tightens the grip on the code and sends hordes of open source developers to greener pastures," Paula Rooney So rated in her ZDNet.

That's not to say there aren't other open source alternatives. MariaDB is a fork of MySQL that is still "true open source". MariaDB developer SkySQL explains , "All code in MariaDB is released under the GPL, LPGL, or BSD. There are no closed-source modules in MariaDB like in MySQL Enterprise Edition . In fact, all closed-source modules in MySQL 5.5 Enterprise Edition The features are all found in the MariaDB open source release."

The conclusion is: the pure open source MySQL is now essentially MariaDB.

2. The performance of MySQL is not as good as its competitor MariaDB

The MariaDB blog provides detailed benchmark results for the latest MySQL and MariaDB versions, and although the results were close, MariaDB took the lead .

3.  MySQL is now owned by Oracle, not community-driven

MySQL hasn't changed direction significantly since being acquired by Oracle, but Oracle still owns it, which makes some developers nervous. "And, perhaps worst of all, it's impossible for the community to work with Oracle's MySQL developers ," said Michael "Monty" Widenius, founder of MySQL and MariaDB.

Widenius noted that Oracle does not accept patches or provide a public roadmap. "There's no way to talk to the MySQL developers about how things are implemented or how the current code works," he said. If an open source, community-developed database is important to you, Widenius recommends MariaDB (duh!) because it's built on top of MySQL and offers more features, speed, and stability with fewer security concerns.

4. Large companies start to skip tickets

At a summit in Boston in June 2013, Red Hat announced that it was breaking up with MySQL . Instead, Red Hat Enterprise Linux (RHEL) will ship with MariaDB. Fedora has announced that it will migrate from the MySQL to MariaDB branch in Fedora 19. Slackware Linux announced its migration from MySQL to MariaDB in March 2013, and openSUSE made a similar announcement in January 2013 .

The Qt official has always been adhering to the concept of the open source community, which runs counter to the essence of MySQL now, so qt6 began to cancel the support for MySQL by default.

5. Why MySQL is increasingly abandoned while MariaDB continues to grow

With the decline in popularity of the MySQL database and the massive shift to MariaDB, you might wonder what has made MariaDB such a success since its inception. In this section, we'll highlight some of the key improvements and features that drove MariaDB's growth and consequent popularity.

First, MariaDB does not require a license, especially in a production/commercial environment. Since being acquired by Oracle, MySQL now requires a license for commercial purposes. This move forced thousands of developers to choose MariaDB. XAMPP, a popular web server stack, even dropped MariaDB's MySQL in its LAMP stack. Since no license is required for deployment, MariaDB is therefore considered a true open source RDBMS - Relational Database Management System.

MariaDB has built-in and powerful clustering capabilities called Galera clusters, capable of providing master-to-master and master-slave replication. It provides automatic node joining, row-level parallel replication, and synchronous replication with read and write capabilities to any node in the cluster. In addition, you can afford to lose nodes in your cluster without fear of disruption to cluster operations and without having to deploy complex failover plans.

MariaDB also comes with a built-in powerful storage engine and useful plugins . The Cassandra storage engine supports NoSQL and can accommodate both SQL and NoSQL systems. TokuDB helps to handle big data and is ideal for high-performance and resource-intensive environments. Other cutting-edge storage engines include Aria and XtraDB , which replaced the old MyISAM and InnoDB in MySQL, respectively.

Other new and cool features built into MariaDB include the ColumnStore engine tailored specifically for data warehouses , the CONNECT storage engine built to facilitate MariaDB's access to local and remote data , and MyRocks , an LSM database that offers excellent compression Than, the SEQUENCE engine for creating sequences (whether ascending or descending from a given reference point or starting value) and the Spider engine. few.

Not only does MariaDB have better performance in query optimization, but it also has better performance in other functions . When clients connect to MariaDB, it's fast, and  both MariaDB 10.1 and 10.2 added more improvements. This makes MariaDB a more popular choice for MySQL.

As cyber threats and vulnerabilities continue to increase, MariaDB developers regularly issue security bulletins and take advantage of patches and upgrades. Also, their release notes contain all the latest CVE identifiers . That's a far cry from MySQL, which has less frequent security bulletins and is known to be vague, making patch management difficult to enforce. Also, there is a huge discrepancy between the CVE identifiers listed in the release notes and what currently exists.
It's worth mentioning that MariaDB has better tests, which helps reduce errors in compilation warnings and errors. This is mainly due to the large community of contributors, and developers whose sole goal is to improve the database system. All source code is released under the General Public License (GPL), and all closed-source modules in MySQL exist in the open-source MariaDB. This makes MariaDB a true open source database system.

Finally, MariaDB is a drop-in replacement for MySQL, and migrating from MySQL to MariaDB is just a few commands away. If you are running some MySQL database instances, you just need to remove/purge the MySQL package and install MariaDB, the settings will be migrated automatically.

MariaDB's growth will remain unimpeded, mainly due to its vibrant and open-source community that promotes better and cleaner code maintenance, and this is precisely the main reason why Oracle MySQL is criticized, lacks community channels, does not accept Patches and public routes, with an emphasis on commercial releases . The database system is also packed with tons of useful features that promise an immersive experience. In the next few years, we may see more companies turn to MariaDB, as applications become more complex and require more powerful, stable and secure database systems.


There is no built-in MySQL driver (QMYSQL) in the Qt environment. If users still want to use 0t connection to operate MVSQL, they can only use the Qt source code project to compile and generate the MySQL driver DLL library, and then introduce it into the development environment. The process is cumbersome. The following describes Specific operation steps.

1. First open the "lib" folder under the MySQL installation directory, and see that there are two files "libmysqldll" and "libmysqllib", copy them to the "bin" directory of Qt's MinGw compiler;

2. Find the "mysql" folder in the source code directory under the Qt installation directory ("C:Qt\6.5\Src\qtbase\src\plugins\sqldrivers\mysql", please search according to the actual path you installed) to enter this file Folder, it can be seen that there is a Qt project configuration file named "mysql.pro";

3. Start QtCreator, navigate to the "mysql" folder, open the Qt project corresponding to "mysql.pro", and run this project;

4. Open the "mysql" folder, and you can see that there is an additional "lib" subfolder, enter and you can see the 3 files generated by compilation;

Among them, "qsqlmysql.dll" and "qsqlmysql.dll.debug" are the drivers of the MySQL database in the Qt environment that we need.

5. Copy the MySQL driver to the Qt "sqldrivers" folder, select the "qsqlmysql.dll" and "qsqlmysql.dll.debug" driver files generated above and copy them, and paste them into the "sqldrivers" file in the qt installation directory Folder, which successfully adds the MySQL driver to the qt environment, and you can use this driver to access the MySQL database in subsequent programming.

Guess you like

Origin blog.csdn.net/yanchenyu365/article/details/130840051