Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSqlQuery::prepare: database not open
Qt 6.11 is out! See what's new in the release blog

QSqlQuery::prepare: database not open

Scheduled Pinned Locked Moved Unsolved General and Desktop
30 Posts 6 Posters 28.6k Views 3 Watching
  • 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.
  • R RekTek249

    @SGaist When I go to the "remote mysql" part of the site, it gives an access host... do i gotta use this as the hostname ?

    R Offline
    R Offline
    RekTek249
    wrote on last edited by RekTek249
    #21

    @RekTek249 If that's what i do, it gives that error:

    QSqlError("1045", "QMYSQL: Unable to connect", "Access denied for user 'rektek_write'@'*ip here*.' (using password: YES)")
    

    If it's a permission problem, what do I need to do ? I have the insert one because that's the only thing I need to do...

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #22

      Is this user authorised to access the database from outside that machine ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply
      0
      • SGaistS SGaist

        Is this user authorised to access the database from outside that machine ?

        R Offline
        R Offline
        RekTek249
        wrote on last edited by
        #23

        @SGaist Well it's a website host.... They wouldn't allow you to create hosts that can only connect on that machine i guess.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #24

          That I don't know, you should ask them.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply
          0
          • SGaistS SGaist

            That I don't know, you should ask them.

            R Offline
            R Offline
            RekTek249
            wrote on last edited by
            #25

            @SGaist Alright... I checked something and apparently for remote you need the user's ip. The control panel needs the ip so I guess I can't make this application public because they wont be able to access the database ?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #26

              Then implement a REST service to expose what you need for your application.

              What exactly are you trying to implement ? Because currently it seems you are trying to do server-side stuff from your application.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              R 1 Reply Last reply
              0
              • SGaistS SGaist

                Then implement a REST service to expose what you need for your application.

                What exactly are you trying to implement ? Because currently it seems you are trying to do server-side stuff from your application.

                R Offline
                R Offline
                RekTek249
                wrote on last edited by
                #27

                @SGaist I just need to store (INSERT) things in a database... And what is a REST ?

                the_T jsulmJ 2 Replies Last reply
                0
                • R RekTek249

                  @SGaist I just need to store (INSERT) things in a database... And what is a REST ?

                  the_T Offline
                  the_T Offline
                  the_
                  wrote on last edited by
                  #28

                  @RekTek249
                  See https://www.tutorialspoint.com/restful/

                  -- No support in PM --

                  1 Reply Last reply
                  0
                  • R RekTek249

                    @SGaist I just need to store (INSERT) things in a database... And what is a REST ?

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #29

                    @RekTek249 Yes, you should implement a REST interface - exposing a SQL database to the public internet isn't a good idea.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #30

                      To add to @the_, the tutorial explains thing nicely but there are more lightweight options than a full Java + eclipse + tomcat setup to get started.

                      Python wise there's the Django REST framework or Flask RESTful

                      PHP wise there's PHP Slim

                      There are also other options but you'd have to first share what you have available on your server.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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