My environment is win10. Exe files are generated by qt5.12.6 + MySQL 5.7.29.
Run exe to find that the database cannot be connected, and the error is as follows:
QSqlDatabase：QMYSQL driver not loaded
Open datatabase error：”Driver not loaded Driver not loaded”
I watched it online for two days and tried it for two days, but there was no change. But after a comprehensive analysis, it will be solved.
1. Copy libmysql.dll under D: \ MySQL \ mysql-5.7.29-winx64 \ lib to the directory of. Exe;
2. Copy the D: \ QT \ qt5.12.6 \ 5.12.6 \ SRC \ qtbase \ SRC \ plugins \ sqldrivers \ plugins \ sqldrivers folder to the directory of. Exe.
The above paths are different according to the actual situation of individuals, and are based on their own local.
After completing the above steps, EXE can connect to the database.
weixin_ thirty million three hundred and ninety-nine thousand eight hundred and twenty-one
weixin_ forty-five million seven hundred and thirty-eight thousand two hundred and eighteen
- MySQL driver compiling method of QT under windows and solutions to abnormal errors
- Error: property ‘TZ’ does not exist on type ‘type of moment’
- Python：ImportError: No module named indexes.base
- Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj.jdb
- Solve the problem that dbvisualizer cannot connect to mysql8
- ERROR 1524 (HY000): Plugin ‘auth_socket’ is not loaded How to Fix
- Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNot
- Error dropping database can’t rmdir
- Solve MySQL installation error: initializing database prompts an error when installing mysql
- Error 1045 (28000) access denied for user ‘root’ @’localhost ‘appears in MySQL under Windows system
- MySQL error: error 1010 (HY000) when deleting database
- Springboot uses druid to log in MySQL. An error occurred: access denied: errorcode 1045, state 28000
- [error handling] idea error reporting com.alibaba.druid . pool.DruidDataSource error
- Solution to error 2002 (HY000) in MySQL login startup
- mysql ERROR 1050 (42S01): Table already exists
- Talking about the errors encountered in installing MySQL ODBC (error 1918)
- Navicat import local SQL file error “[MSG] finished – unsuccessfully | [err] 1046 – no database selected”
- After installing MySQL again under Linux, the solution of ‘MySQL module failed to start’ appears