Conexión a BD MySql remota

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
edufloriv
Posts: 159
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB
Location: PERU
Has thanked: 3 times
Been thanked: 6 times

Conexión a BD MySql remota

Post by edufloriv » Thu May 02, 2019 7:55 pm

Saludos amigos,

Tengo contratado un host y he creado en el una base de datos MySQL:
base-1.png
base-1.png (116.44 KiB) Viewed 340 times
base-2.png
base-2.png (105.23 KiB) Viewed 340 times
Estoy tratando de usar este código para conectarme a ella:

Code: Select all

*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*

PROC ConexionRemota

	// Connect

	oServer := TMySQLServer():New("51.254.123.233" , "ago28ind_root" , "clave")

	// Check For Error

	If oServer:NetErr()

		MsgStop(oServer:Error())
		Win_1.Title := 'MySql Basic Sample - Not Connected' 

	Else

      If oServer:NetErr()
         MsgStop(oServer:Error())
      Else
         oServer:SelectDB("ago28ind_infofarma")
         Win_1.Title := 'MySql Basic Sample - Connected' 
      Endif

	EndIf

Return
Pero no se conecta, siempre me sale el mensaje "No connection to server". Agradeceré la ayuda de los que tengan experiencia conectando a bases de datos remotas.


Att.

Eduardo Flores Rivas


LIMA - PERU

User avatar
serge_girard
Posts: 2314
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 555 times
Been thanked: 116 times
Contact:

Post by serge_girard » Thu May 02, 2019 8:12 pm

Eduardo,

Check if your IPaddress is allowed to access remote.

Serge

User avatar
dragancesu
Posts: 672
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 21 times
Been thanked: 135 times

Post by dragancesu » Fri May 03, 2019 3:51 am

Ask your hosting provider

It's disable by default, enable only connect by localhost, your php work on localhost

User avatar
edufloriv
Posts: 159
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB
Location: PERU
Has thanked: 3 times
Been thanked: 6 times

Post by edufloriv » Fri May 03, 2019 1:19 pm

Good morning friends,

I first get my ip address:
myipaddress.png
myipaddress.png (319.67 KiB) Viewed 281 times
Then I configure at cpanel like this
anfitrion.png
anfitrion.png (110.35 KiB) Viewed 281 times
Please confirm me thats ok, so I will call my hosting provider.


Greeting regards,

*----------------------------------------------------------------------------------------------------------------------------------------------------*

Buenos días amigos,

Primero obtengo mi dirección IP:
myipaddress.png
myipaddress.png (319.67 KiB) Viewed 281 times
Entonces lo configuro en cpanel asi
anfitrion.png
anfitrion.png (110.35 KiB) Viewed 281 times
Por favor, confírmenme que está bien, así llamaré a mi proveedor de alojamiento.


Saludos cordiales,

Eduardo Flores Rivas


LIMA - PERU

User avatar
serge_girard
Posts: 2314
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 555 times
Been thanked: 116 times
Contact:

Post by serge_girard » Fri May 03, 2019 2:32 pm

Looks OK to me!
Serge

User avatar
zolysoftsolutions
Posts: 121
Joined: Wed Feb 29, 2012 3:33 am
Location: Gyulakuta, Erdélyország
Has thanked: 1 time
Contact:

Post by zolysoftsolutions » Fri May 03, 2019 8:50 pm

Hi,
Try to make this setting in your cPanel.
dbremote.png
dbremote.png (22.58 KiB) Viewed 239 times
Zoli B.
_______________________________
Open eyes for you!

Post Reply