Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. German
  4. Qt 5.2.1 MySQL SQL Driver installieren [SOLVED]

Qt 5.2.1 MySQL SQL Driver installieren [SOLVED]

Scheduled Pinned Locked Moved German
92 Posts 2 Posters 57.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nickvan86
    wrote on last edited by
    #7

    Hab halt im Verzeichnis C: die lib von MySQL connector c++

    Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clochydd
      wrote on last edited by
      #8

      Die lib werden benötigt, um das plugin zu erstellen.
      Das plugin besteht aus den DLLs: qsqlmysql4.dll und qsqlmysqld4.dll
      Wenn du die nicht hast, musst du sie bauen (s.o. Qt 5.2 -> Qt SQL -> SQL Database Drivers). Die DLLs müssen exakt zu deiner Systemumgebung passen, daher sollten sie stets in der passenden Konfiguration erstellt werden.

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nickvan86
        wrote on last edited by
        #9

        @cd %QTDIR%\src\plugins\sqldrivers\mysql
        qmake "INCLUDEPATH+=C:/MySQL/include" "LIBS+=C:/MYSQL/MySQL Server <version>/lib/opt/libmysql.lib" mysql.pro
        nmake@

        Das habe ich gefunden. gebe ich das bei der cmd ein

        Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

        1 Reply Last reply
        0
        • C Offline
          C Offline
          clochydd
          wrote on last edited by
          #10

          Das schaut nicht schlecht aus - am Ende müsstest du die DLLs erhalten, wenn das make ohne Fehler läuft.
          Falls Fehlermeldungen erscheinen, bitte posten. Bin allerdings jetzt ein paar Stunden nicht am Rechner...

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nickvan86
            wrote on last edited by
            #11

            Du kein Problem. Werde es mal einfach Probieren. Dann sehe ich ja was passiert.

            Danke nochmals ;-)

            Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

            1 Reply Last reply
            0
            • C Offline
              C Offline
              clochydd
              wrote on last edited by
              #12

              Sehr gern :-)

              1 Reply Last reply
              0
              • N Offline
                N Offline
                nickvan86
                wrote on last edited by
                #13

                @qmake "INCLUDEPATH+=C:/MySQL/include" "LIBS+=C:/MYSQL/MySQL Server <version>/lib/opt/libmysql.lib" mysql.pro@

                Hab diesen Befehl ausführen wollen und es kam als Meldung:

                'qmake' is not recognized as an internal or external comman, operable program or batch file

                und befinde mich in folgenden ordner:

                c:\Qt\5.2.1\Src\qtbase\src\plugins\sqldrivers\mysql

                Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  clochydd
                  wrote on last edited by
                  #14

                  Wir kommen der Sache näher:
                  qmake.exe ist ein Tool, das zum Umfang von Qt gehört (ein Generator für makefiles) und mit Qt installiert wird. Du solltest jetzt prüfen, ob das Programm vorhanden ist und PATH entsprechend über die Systemsteuerung anpassen.

                  1 Reply Last reply
                  0
                  • N Offline
                    N Offline
                    nickvan86
                    wrote on last edited by
                    #15

                    Was meinst du mit PATH?

                    Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

                    1 Reply Last reply
                    0
                    • N Offline
                      N Offline
                      nickvan86
                      wrote on last edited by
                      #16

                      Unter den Ordner mingw48_32 in der bin gibt es ne qmake

                      Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        clochydd
                        wrote on last edited by
                        #17

                        Sieht schon nicht schlecht aus!
                        Path ist eine Systemvariable in Windows, die den Suchpfad enthält.
                        Ein Programm wie qmake.exe wird im cmd-Fenster nur dann gefunden, wenn es in einem Verzeichnis steht, auf das "Path" verweist.
                        Die Variable "Path" musst du wie folgt bearbeiten:
                        bq.
                        Systemsteuerung
                        ->System und Sicherheit
                        ->System
                        ->Erweiterte Systemeinstellungen
                        ->Umgebungsvariablen
                        ->Systemvariablen

                        in der Listbox Path auswählen und dann:

                        Bearbeiten
                        ans Ende der Zeile ein Semikolon und den gesamten Pfad eintragen
                        (Bsp. ;C:\Qt5.2.1\5.2.1\mingw48_32)

                        1 Reply Last reply
                        0
                        • N Offline
                          N Offline
                          nickvan86
                          wrote on last edited by
                          #18

                          @cd %QTDIR%\src\plugins\sqldrivers\mysql@

                          Bei dem kommt The system cannot find the path specified.

                          Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

                          1 Reply Last reply
                          0
                          • N Offline
                            N Offline
                            nickvan86
                            wrote on last edited by
                            #19

                            Den Ordner sqldrivers finde ich in mehrere Ordner von Qt. Ist es dir unter Tools\QtCreator\bin\plugins\sqldrivers?

                            Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

                            1 Reply Last reply
                            0
                            • N Offline
                              N Offline
                              nickvan86
                              wrote on last edited by
                              #20

                              Befinde mich nun im folgenden Pfad

                              C:\Qt\5.2.1\Src\qtbase\src\plugins\sqldrivers\mysql

                              und habe danach folgendes eingegeben

                              qmake "INCLUDEPATH+=C:/MySQL/include" "LIBS+=C:/mysql/MySQL Server 5.6/lib/libmysql.lib" mysql.pro

                              Danach hat er mir nur wieder den Pfad angezeigt ohne irgendwelche Meldung

                              Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

                              1 Reply Last reply
                              0
                              • C Offline
                                C Offline
                                clochydd
                                wrote on last edited by
                                #21

                                Das ist korrekt, den Ordner sqldrivers gibt es mehrfach: Im Quellcode und im Qt-Pfad.
                                Die kompilierten Treiber (.dll) müssen in:
                                C:\Qt\Qt5.2.0\5.2.1*\mingw48_32\plugins\sqldrivers*
                                liegen

                                1 Reply Last reply
                                0
                                • N Offline
                                  N Offline
                                  nickvan86
                                  wrote on last edited by
                                  #22

                                  Habe folgende *.dll
                                  qsqlite.dll
                                  qsqlited.dll
                                  qsqlmysql.dll
                                  qsqlmysqld.dll
                                  qsqlodbc.dll
                                  qsqlpsql.dll
                                  qsqlpsqld.dll

                                  :-)

                                  Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

                                  1 Reply Last reply
                                  0
                                  • N Offline
                                    N Offline
                                    nickvan86
                                    wrote on last edited by
                                    #23

                                    Führe ich folgendes Projekt aus:

                                    @QSqlDatabase mydb1 = QSqlDatabase::addDatabase("QMYSQL");
                                    mydb1.setHostName("10.211.55.6");
                                    mydb1.setDatabaseName("test");
                                    mydb1.setUserName("test");
                                    mydb1.setPassword("server");
                                    mydb1.setPort(3306);

                                    if(!mydb1.open())
                                    {
                                        cout << "Database Error";
                                        return false;
                                    }
                                    else
                                    {
                                        cout << "Database true";
                                        return true;
                                    }@
                                    

                                    Und in der pro habe sql mit qmake gemacht

                                    Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

                                    1 Reply Last reply
                                    0
                                    • C Offline
                                      C Offline
                                      clochydd
                                      wrote on last edited by
                                      #24

                                      Funktioniert das denn jetzt?

                                      1 Reply Last reply
                                      0
                                      • N Offline
                                        N Offline
                                        nickvan86
                                        wrote on last edited by
                                        #25

                                        Nein. Leider nicht :-(

                                        wo muss ich die libmysql.dll hin kopieren? musste man die nicht in ein windows Verzeichnis laden?

                                        Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

                                        1 Reply Last reply
                                        0
                                        • C Offline
                                          C Offline
                                          clochydd
                                          wrote on last edited by
                                          #26

                                          Die dlls müssen in C:\Qt\Qt5.2.0\5.2.1\mingw48_32\plugins\sqldrivers liegen. (evtl. C:\Qt\Qt5.2.0\5.2.1 gegen den entsprechenden Pfadnamen deines Rechners austauschen)
                                          Wenn das nicht funktionieren sollte (was meist an Problemen mit der Path-Variablen liegt) kannst du auch ein Unterverzeichnis sqldrivers unter dem Build-Verzeichnis anlegen, das im Creator unter Projekte definiert ist (z.B. QBUILD\debug\meinprojekt), und die dlls auch dahin kopieren.
                                          Das ist zwar nicht elegant aber zum Testen ggf. sinnvoll.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved