QSqlDatabase specify database name after ip address
-
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 like10.214.1.101/testDatabase
but its not working. Can someone please help me with the syntax to connect to the database. -
@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. -
@brighton64 The link I posted shows an example with MySQL
-
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.