How to Set ODBC MySQL Driver
Why Stack Overflow recommends it
Stack Overflow users link it when someone can't connect to MySQL through ODBC from Qt, MFC, ColdFusion or Excel VBA and needs to add the driver and DSN on Windows.
Recommended by 4 people across 4 different months, 2013 to 2017.
What it is
A 2-minute step-by-step screencast from HowTech showing how to download, install and configure the MySQL ODBC driver on Windows. It walks through the installer and then the Control Panel and Administrative Tools steps for setting up a data source.
What people said
Recommends sashoalm · 2014-08 · Stack Overflow · on “How to connect to a MySQL database through ODBC from Qt application?”
It turned out that I need to add MySQL to the ODBC data sources. I did that after following this video tutorial - [this video] . After I had added the DSN, I successfully connected to the MySQL server using this code: QSqlDatabase db = QSqlDatabase::addDatabase("QODBC"); db.setDatabaseName("Driver={MySQL ODBC 5.3 Unicode Driver};DATABASE=test;"); db.setUserName("root"); db.setPassword("password"); if (!db.open()) { qDebug() << db.lastError().text(); } else { qDebug("success"); } Note: You will need to replace MySQL ODBC 5.3 Unicode Driver with the actual value listed in your DSN window. I got mine from here:
Recommends SusanneBoghossian · 2015-01 · Stack Overflow · on “Database connection required for MFC smartcard application using VC++”
Please set up a normal visual studio project. don't check the options for the database support. when your project is created, open the class wizard and on the right side, you open the dropdown. Select the option "ODBC-Consumer". After that, you can chose your ODBC Setup. iIf you don't know what this is, watch this: [this video]
Recommends Andy · 2015-03 · Stack Overflow · on “Attach a mySQL datasource in CF Admin”
Hi People and thanks for your response. Turns out I needed to download and install the ODBC driver for MySQL from mysql.com. There is a very go video on youtube: [this video] I followed the instructions and everything is perfect. Scott, I do have an s/a actually "sa" for msSQL username and I thought I had assigned it to MySQL also but "root" was the proper user name. Andy
Recommends lorenzo · 2017-01 · Stack Overflow · on “How to connect Qt C++ program to an online MySQL database through ODBC (without MySQL Qt Driver compiled)”
I was having the following problem that I resolved casually doing lot of attempts: I need to connect my Qt application to an online mysql database, so I tried lot of times to connect my program to my database, but things didn't works. At first I had problems to compile MySql driver for Qt, I followed every guide and topic on the web about that but I got always error, so I decided to use ODBC that it's ready for work without any compilation. So I followed lot of guides and topics about the connection to MySQL through ODBC in Qt (including this: How to connect to a MySQL database through ODBC from Qt application? [LINK] ) but I got always errors also this time. The official documentation of Qt
Cites user2491612 · 2013-12 · Stack Overflow · on “Excel-Vba Connect Mysql localhost failed”
I fixed it but unfortunate don't even know how. All I know is when I finally changed code above `DRIVER={MySQL ODBC 3.51 Driver}` to `DRIVER={MySQL ODBC 5.2 ANSI Driver}` it worked. other links that help: [this video] [LINK]