FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Connect with MySql database
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Connect with MySql database
Posted: Sat Feb 02, 2019 07:24 AM

Hi !

I connectus with the MySql database through maria_connect(). The default port is 3306. How can I have another port ?

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Connect with MySql database
Posted: Sat Feb 02, 2019 10:29 AM

You can suffix port number to cServerAddress with ":"
Example:
maria_Connect( "host:3455", "db", "user", "pw" )

Or
maria_Connect( "host", "db", "user", "pw", nPort )

Regards



G. N. Rao.

Hyderabad, India
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Connect with MySql database
Posted: Sat Feb 02, 2019 10:55 AM

Thank you, Mr.Rao ! I didn't know all the parameters of the maria_connect method. Where can I see them ?

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Connect with MySql database
Posted: Sat Feb 02, 2019 11:52 AM
1) As we always recommend, if you use command syntax, you will be fully informed and never go wrong.


fwh\include\fivewin.ch
Code (fw): Select all Collapse
#xcommand FWCONNECT <oCn> HOST <cHost>  ;
         [<usr:USER,LANGFOLDER> <cUser> ] ;
         [ PASSWORD <cPassword>] ;
         [ <db:DB,DATABASE> <cDB> ] ;
         [ PORT <nPort> ] [ FLAGS <nFlags> ] ;
         [ CHARSET <chrset> ] [ MESSAGES <msglang> ] [ LOCALE <locale> ] ;
      => ;
      <oCn> := maria_Connect( <cHost>, [<cDB>], <cUser>, <cPassword>, [<nPort>], [<nFlags>], [<chrset>], [<msglang>], [<locale>] )

By examining the command translate, you will also know the full syntax.

2) You can refer to the documentation in the posts given in
viewtopic.php?f=3&t=33286
This post is always available at the top of the forum,

3) It is better to keep referring to whatsnew.txt whenever a new version is released.

4) You may refer to FiveWiki
http://wiki.fivetechsoft.com/doku.php?i ... connection
http://wiki.fivetechsoft.com/doku.php?i ... ariarowset

However, FiveWiki may not be always fully upto date and so this information is to be supplemented by whatsnew.txt.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion