PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Opening MySQL on a remote server using ADO command tag  (Read 1062 times)

michaelgreer

  • Diamond Member
  • *****
  • Posts: 129
    • View Profile
Opening MySQL on a remote server using ADO command tag
« on: May 04, 2021, 10:27:38 AM »
I have a situation where I need to access a SQL database on a different server than the one where I am running PxPlus (same network).  Can someone give me a working example of an open command  to do this. It is not clear to me from the documentation where I specifiy the ip address for the server.

EVa

  • Gold Member
  • ****
  • Posts: 54
    • View Profile
    • EDIAS
Re: Opening MySQL on a remote server using ADO command tag
« Reply #1 on: May 04, 2021, 11:00:50 AM »
The syntax would [MySQL]Database;Table;host=ip_addr;user=name;pswd=password;etc...



Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: Opening MySQL on a remote server using ADO command tag
« Reply #2 on: May 05, 2021, 08:26:39 AM »
If you are connecting to a MySQL database you likely want to use the [mysql] tag in your open. The [ado] tag is used for connecting with Microsoft SQL Server databases.

The example in the post above is correct and you can use the host= option to specify the server address where the MySQL DB is hosted. I would also add that you may need to also use the port= option to specify the port the MySQL server is running on. For details of the different [mysql] options please see https://manual.pvxplus.com/?command_tags/mysql.htm

OPEN (HFN)"[MySQL]Database;Table;host=ip_addr;port=port_num;user=name;pswd=password;"
Principal Software Engineer for PVX Plus Technologies LTD.