473,657 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mysql accessed remotely

I want to know how you can access a remote mySQL database from a php script.

Also how can I connect to a remote mysql database from mysql administrator?
Jul 17 '05 #1
8 2251
Kenneth wrote:
I want to know how you can access a remote mySQL database from a php
script.
mysql_connect($ ipaddress, $username, $password);

where $ipaddress is the IP address of the server you want to connect to.
Note that you may not be able to connect to a remote mysql database if
a) the firewall blocks the mysql port b) mysql is not configured to
listen to a port or c) your login doesn't have privileges to connect
remotely.
Also how can I connect to a remote mysql database from mysql
administrator?


Find the configuration dialog and set the hostname to an IP address. See
above notes about why you still may not be able to connect.

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Jul 17 '05 #2
Here is the message i get when i use

mysql_connect($ ipaddress, $username, $password);
error:

Warning: mysql_connect() : Unknown MySQL Server Host 'db195.perfora. net'
(1) in /oldhome/WWW/wingsofthedawn. org/htdocs/final/Connections/myDB.php
on line 9

Fatal error: Unknown MySQL Server Host 'db195.perfora. net' (1) in
/oldhome/WWW/wingsofthedawn. org/htdocs/final/Connections/myDB.php on line 9


Chris Hope wrote:
Kenneth wrote:

I want to know how you can access a remote mySQL database from a php
script.

mysql_connect($ ipaddress, $username, $password);

where $ipaddress is the IP address of the server you want to connect to.
Note that you may not be able to connect to a remote mysql database if
a) the firewall blocks the mysql port b) mysql is not configured to
listen to a port or c) your login doesn't have privileges to connect
remotely.

Also how can I connect to a remote mysql database from mysql
administrator ?

Find the configuration dialog and set the hostname to an IP address. See
above notes about why you still may not be able to connect.

Jul 17 '05 #3
>mysql_connect( $ipaddress, $username, $password);


error:

Warning: mysql_connect() : Unknown MySQL Server Host 'db195.perfora. net'
(1) in /oldhome/WWW/wingsofthedawn. org/htdocs/final/Connections/myDB.php
on line 9

Fatal error: Unknown MySQL Server Host 'db195.perfora. net' (1) in
/oldhome/WWW/wingsofthedawn. org/htdocs/final/Connections/myDB.php on line 9


db195.perfora.n et is not a valid hostname. Fix your hostname
or fix your DNS.

Gordon L. Burditt
Jul 17 '05 #4
Gordon, why is not a valid hostname. and also how do i get the ip for
db195.perfora.n et?
Gordon Burditt wrote:
mysql_connect ($ipaddress, $username, $password);
error:

Warning: mysql_connect() : Unknown MySQL Server Host 'db195.perfora. net'
(1) in /oldhome/WWW/wingsofthedawn. org/htdocs/final/Connections/myDB.php
on line 9

Fatal error: Unknown MySQL Server Host 'db195.perfora. net' (1) in
/oldhome/WWW/wingsofthedawn. org/htdocs/final/Connections/myDB.php on line 9

db195.perfora.n et is not a valid hostname. Fix your hostname
or fix your DNS.

Gordon L. Burditt

Jul 17 '05 #5
Kenneth wrote:
Gordon, why is not a valid hostname. and also how do i get the ip
for db195.perfora.n et?


You run "nslookup db195.perfora.n et" to get the IP address. This tells
you that there is no such hostname which is why Gordon would have said
it's not valid.

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Jul 17 '05 #6
So what is the next step?
Chris Hope wrote:
Kenneth wrote:

Gordon, why is not a valid hostname. and also how do i get the ip
for db195.perfora.n et?

You run "nslookup db195.perfora.n et" to get the IP address. This tells
you that there is no such hostname which is why Gordon would have said
it's not valid.

Jul 17 '05 #7
Kenneth wrote:
Gordon, why is not a valid hostname. and also how do i get the ip
for db195.perfora.n et?


You run "nslookup db195.perfora.n et" to get the IP address. This
tells you that there is no such hostname which is why Gordon would
have said it's not valid.


So what is the next step?


Use a valid hostname. Or find out the actual IP address of the server
you are trying to connect to. It's better to use the IP address anyway
to prevent any extra latency required in looking it up each time your
script wants to connect to the server.

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Jul 17 '05 #8
Chris you were right it was behind a firewall. So now I am running
script inside the server.

Thanks.
Chris Hope wrote:
Kenneth wrote:

Gordon, why is not a valid hostname. and also how do i get the ip
for db195.perfora.n et?

You run "nslookup db195.perfora.n et" to get the IP address. This
tells you that there is no such hostname which is why Gordon would
have said it's not valid.


So what is the next step?

Use a valid hostname. Or find out the actual IP address of the server
you are trying to connect to. It's better to use the IP address anyway
to prevent any extra latency required in looking it up each time your
script wants to connect to the server.

Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2844
by: filesiteguy | last post by:
Some partners of mine and I are writing a host-based application, which would greatly benefit if we could take advantage of a web services-like function we are formulating. Unfortunately, this requires a centralized (or duplicated) MySQL database which can be accessed via several web hosting providers. In my experience, typically web hosting providers only allow localhost access to MySQL databases.
4
2565
by: Dave Moore | last post by:
Hi All, I'm looking at using PHP and MySQL for a particular website application. However, I was a bit concerned that if a PHP script went wrong then it would be possible to accidentally delete or overwrite large chunks of the data in the database which presumably would then be lost. What is the usual procedure for these situations?. Is it possible to back up a database somehow so that data from a previous time can be retrieved?. Ta,...
0
2269
by: Duane Winner | last post by:
Hello all - I'm having a small problem with the mysql startup script that ships with MySQL-3.23.56-1. I'm running on RedHat Linux. It works fine, but I have a backup server that runs a script that passes these commands remotely through ssh: (1) ssh dbsys-dc "sudo /etc/init.d/mysql stop" (2) ssh dbsys-dc "sudo tar
3
2586
by: pc | last post by:
hi everyone, I am trying to connect to a new mysql installation. I have given root permission to connect to all databases from anywhere; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'passwd' WITH GRANT OPTION; I can log on locally by specifying the host name:
5
3847
by: Ike | last post by:
Through Java, I am attempting to connect to a MySQL 4.12 server on a remote computer. I can connect fine via php. I cann connect fine via Java, through a servlet, when the servlet is on the same machine (localhost) as the MySQL DB. However, when they are on different machines with different IPs, calling across the Internet (and there are no firewall issues -- I can connect fine to the remote MySQL DB via php from the same machine, not...
0
4641
by: mdavila78 | last post by:
Hi there, I was wondering if it's possible to Clear MySQL's History Remotely. Considering that you only have root access to the database but no access to the linux box. I found something in Goggle to do this, but you need to have access to the linux box:
12
2717
by: mistral | last post by:
phpMyAdmin 2.6.2 problem: can no connects to mySQL database: each time shown error #1045 - Access denied for user 'username'@'192.168.1.2' (using password: YES) Is seems, this is most common problem for mySOL and phpMyAdmin. Extremelly ugly and inconvenient program.
4
2613
by: martinf | last post by:
Hello group, I've inherited a box running FC6. The website I'm trying to copy across to it ran fine on FC5.. PHP & MySQL were set up 'out-the-box' so the site just worked. Somethings changed with FC6. Trying to run the DB script now gives:
3
2822
by: Sonasang | last post by:
Hi , I am develping a web page with MYSQL as backend.... I have installed MYSQL and MYSQL connector to access the datas remotely... But i am getting the error when i try to access the data .... In the code for the conn syntax... If i am giving localhost its working fine...
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.