Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt 5.12 static build for webassembly: cannot configure mysql database
Forum Update on Monday, May 27th 2025

Qt 5.12 static build for webassembly: cannot configure mysql database

Scheduled Pinned Locked Moved Solved Installation and Deployment
qt 5.12qt-wasmmysql
5 Posts 2 Posters 2.0k 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.
  • B Offline
    B Offline
    Baru
    wrote on 7 Dec 2018, 14:28 last edited by
    #1

    I want to access mysql database with Qt for webassembly based application. I followed the instructions mentioned here https://blog.qt.io/blog/2018/11/19/getting-started-qt-webassembly/ and did a static build. I am able to build and make the example projects (e.g: gui, quick controls2 based applications) but I am unable to configure mysql. I am a newbie to Qt and can please suggest me a way forward?

    P.s: I am using debian stretch on hyper-v terminal running on windows 10.

    R 1 Reply Last reply 7 Dec 2018, 14:36
    0
    • B Baru
      7 Dec 2018, 14:28

      I want to access mysql database with Qt for webassembly based application. I followed the instructions mentioned here https://blog.qt.io/blog/2018/11/19/getting-started-qt-webassembly/ and did a static build. I am able to build and make the example projects (e.g: gui, quick controls2 based applications) but I am unable to configure mysql. I am a newbie to Qt and can please suggest me a way forward?

      P.s: I am using debian stretch on hyper-v terminal running on windows 10.

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 7 Dec 2018, 14:36 last edited by
      #2

      @Baru said in Qt 5.12 static build for webassembly: cannot configure mysql database:

      but I am unable to configure mysql

      means in detail?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Baru
        wrote on 7 Dec 2018, 14:49 last edited by
        #3

        I mean that with the configure option that I use "~/Qt/5.12.0/Src/configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase" I am only able to get SQLite as the default database.
        Ref to:
        http://doc.qt.io/archives/qt-4.8/sql-driver.html
        which says "Due to the practicalities of dealing with external dependencies, only the SQLite3 plugin is shipped with binary builds of Qt."
        But I would like to enable / build mysql database plugin (I think) as it is the one I use for my application.

        R 1 Reply Last reply 7 Dec 2018, 15:00
        0
        • B Baru
          7 Dec 2018, 14:49

          I mean that with the configure option that I use "~/Qt/5.12.0/Src/configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase" I am only able to get SQLite as the default database.
          Ref to:
          http://doc.qt.io/archives/qt-4.8/sql-driver.html
          which says "Due to the practicalities of dealing with external dependencies, only the SQLite3 plugin is shipped with binary builds of Qt."
          But I would like to enable / build mysql database plugin (I think) as it is the one I use for my application.

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 7 Dec 2018, 15:00 last edited by raven-worx 12 Jul 2018, 15:02
          #4

          @Baru
          i see 2 major problems which are highly possible show breakers:

          1. QNetwork mdule isn't ported yet to Qt WebAssembly (QTBUG-63920) - IIRC (server is currently down)
          2. you would need to compile the mysql lib with emscripten (similar like for Android) and all follow up issues - and there is a high chance that not even all required network API functions are available

          So i think it's even easier - and probably saves a lot of headache - to let the hosting server do the DB access. Like you would do for a normal website.
          You can use QWebSocket to communicate with the host server. QWebSocket is known to be already working with QtWebAssembly.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          5
          • B Offline
            B Offline
            Baru
            wrote on 10 Dec 2018, 07:30 last edited by
            #5

            @raven-worx
            Thanks a lot. Now, I got a perspective on how I can proceed further. I will try the solution with the QWebSocket and see how that goes.
            Cheers!

            1 Reply Last reply
            1

            1/5

            7 Dec 2018, 14:28

            • Login

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