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. QSqlDatabase specify database name after ip address
Forum Updated to NodeBB v4.3 + New Features

QSqlDatabase specify database name after ip address

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 450 Views 1 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.
  • B Offline
    B Offline
    brighton64
    wrote on last edited by
    #1

    How can I connect to a database that is hosted on a specific ip address in such a manner that there are multiple databases on the same IP address.
    I tried using a forward slash like 10.214.1.101/testDatabase but its not working. Can someone please help me with the syntax to connect to the database.

    jsulmJ 1 Reply Last reply
    0
    • B brighton64

      How can I connect to a database that is hosted on a specific ip address in such a manner that there are multiple databases on the same IP address.
      I tried using a forward slash like 10.214.1.101/testDatabase but its not working. Can someone please help me with the syntax to connect to the database.

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

      @brighton64 What database is that? MySQL, PostgreSQL, something else?
      Please check https://doc.qt.io/qt-5/sql-connecting.html
      You can specify host (IP or host name) and database for each connection.

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

      B 1 Reply Last reply
      1
      • jsulmJ jsulm

        @brighton64 What database is that? MySQL, PostgreSQL, something else?
        Please check https://doc.qt.io/qt-5/sql-connecting.html
        You can specify host (IP or host name) and database for each connection.

        B Offline
        B Offline
        brighton64
        wrote on last edited by
        #3

        @jsulm It's my Mysql

        jsulmJ 1 Reply Last reply
        0
        • B brighton64

          @jsulm It's my Mysql

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

          @brighton64 The link I posted shows an example with MySQL

          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
            #5

            Hi and welcome to devnet,

            You don't access a database like you do a website.

            You create as many connection to the database host as needed and for each connection you set the database name you want to connect to.

            As @jsulm already wrote, it's explained in the linked documentation.

            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