Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Remote Connection Through Php Script


I have a mysql server running at the office on <officeip>:3306

I have a site hosted by a provider at domain.it

I have granted privileges for existing user office as office@domain.it and office@domainip

I wrote a php script using the parameters:

$host='<officeip>'

$user=office

$pass='<thepass>'

$db='<mydb>'

to connect to the office db from the website.

I get a 'Lost connection' error (no query to execute just connecting so no time-out problem)

What do you believe is wrong with it?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Remote Connection
How do i connect to a remote (webserver) Mysql from the windows command line?

Remote Connection
How do i connect to a remote (webserver) Mysql from the windows command line?

Remote SQL Connection
I am trying to access my database on the server with a MYSQL front-end
client on my computer (not the server). I have the correct username,
password and database name. I tried every possible hostname, even its ip
addy, but each time, I am rejected by the server, which says something
like - access denied. I can access the database in my php code with
'localhost', but that's of course because the code is actually running on
the server. Is there anything I have to specify on the MYSQL server in order
to gain access to it remotely?

Remote Connection
First of all hey guys i'm new to this forum and hope to get some help on getting me fully started with mySQL.

Alrite i've really briefly used mySQL with java but only with a local database.

I need help on how to create remote connections via the internet to mySQL. Basically i've been trying to test out connecting via the internet from my home machine where mySQL is installed, i've tried this through windows command line and doing:

mysql -h myip -u myuser -p

also tried with --port=3306

but it doesn't work. Does the fact that i'm behind a router and have a different local ip matter? Or does the fact that i'm doing this from the machine that holds the mySQL database but i'm using the internet IP address to make it go through the internet. I've already opened up the port in my routers firewall.

I wanted to create a java application that can access a mySQL database over the internet so I thought i'd try out remote connections on windows command line first.

I'm very new to mySQL so any help in the right direction and/or what i'm doing wrong with some explanation will help me give a better understanding.

Remote Connection
just that. and DONOT point me to any documentation ive been through it all mysql will NOT let me give any host persmissions it keeps giving me the syntax crap and to check the menual when i did it just like the friggen manual said

GRANT ALL PRIVILEGES TO db.*
-> root@'host';

and its really pissing me off.
im runing mysql 4.1.8 any ideas?
i also put the host in my hosts file and still nogo

Remote Connection
I'm having a problem connecting to mysql on a remote host because it truncates my user name (dbm.stetsonband.org):

ERROR 1045 (00000): Access denied for user: 'dbm.stetsonband.@d199-126-224-237.abhsia.telus.net' (Using password: YES)

Is there something I need to set in my mysql prefs somewhere?

Remote DB Connection
I am trying to install SAM Broadcaster and it requires tables to be installed on a mysql database remotely. I am not able to connect to the database for some reason and I am wondering if this is maybe because the MySQL server I am trying to connect to has remote connection protection on (if there is such a thing). Is there a way of determining this and is there also a way if this exists to allow remote connections to add tables to a mysql database?

Remote Connection To MySQL
Trying to connect to a MySQL server from my desktop.

Specs:

My Desktop - XP OS - MySQL Administrator.
Server - Red Hat Linus OS - MySQL version 4.x

From the MySQL I am getting an error code 2003 "Can't connect to MySQL server (10060)".  I am using the default port 3006.

Any suggestions?  What additional information do you need to help me out here?

Remote Connection To Sql Server
I've set the remote website, dotbooks.org (207.44.234.74) as an "Access Host" in cPanel.

I'm trying to connect to wiishare.org (70.86.206.218)

The connection string I'm trying is:

<?php

$user = "username";
$password = "password";
$database = "database";

$link = mysql_connect("70.86.206.218", $user, $password);
mysql_select_db($database, $link);
echo mysql_errno($link) . ": " . mysql_error($link). "
";
?>

The string works with localhost, but not like this. It just times out
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in connect.php on line 7 Any suggestions?

MySql Remote Connection
I'm having problems in trying to remote connect to a database and it's driving me nuts.

Database is on server, trying to connect to it through internet using MySQL Control Center with following settings:

Name: Lucca
HostName: IP address of server
UserName: Beeps
Password: """"
Port: 3306

I've made sure that the firewall will allow entry and can successfully ping the server, but I get the following error:

Error 2003: Can't connect to MySQL server on "ip" (10060)

Establishing A Remote Connection
I'm trying to enable remote connections to my mysql database. I'm getting a
java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused

error when I try establish a jdbc connection. I'm supplying the correct user/pass information.

A quick google tells me that I need to enable connections from places other than localhost.
okay, so I do a:

mysql> GRANT ALL PRIVILEGES ON *.* to raghav@'%' identified by 'blah';

As can be seen from the table below, i've tried doing it for anonymous accounts as well, when all of this didn't work. I've flushed privileges, and restarted the mysql server. no luck. Code:

Remote Connection To Database
i have a web-hosted website and i need it to connect to my mysql database is there anyway i could set this up.

Remote Root Connection
I am new here and I have a problem with configuring mysql. How can I set up mysql to allow remote root connections from a specific IP range?? Is this possible at all?

Remote Connection Error
I have been using a database on localhost for a while succesfuly. I am now, however going to be using this same database remotely. Whenever I attempt to connect to the database remotley I am given the error message:
Warning: mysql_connect(): Can't connect to MySQL server on 'my ip' (10060) in C:OpenSAApache2htdocsindex.php on line 9
I have removed the bind-address line from the my.ini file in C:Windows as I read in a previous post you should do, and restarted mysql, but the error still remains. Does anyone know what i'm doing wrong?

Remote MySQL Connection Slow
I have a website on a dedicated server that was running really slow, so I got another, much faster server and transferred the MySQL database to this server. However, now when I connect to the faster server's database using the slower server's PHP web pages, the overall page loads much slower than when the database was on the slower server.

Any ideas why this would be? Right now the host name is just an IP address. Does it need an actual resolved hostname to be fast? MySQL on the faster server is supposedly tweaked for fast service (my-huge.cnf).

Error 2003 On Remote Connection
I have a WinXP Home Edition where I have installed MySQL 4.x

I can use MySQL Administrator on my server, but when I try to connect to my server by entering my WAN-IP, I get the error:

"Could not connect to the specified instance.

MySQL Error Number 2003
Can't connect to MySQL server on xx.xx.xx.xx (10061)".

Remote MySQL Connection Fails
I have two XP computers, with the same version of MySQL on each. I
have the same database structure and data on each. Each computer has
the same user name, and each MySQL database has the same user names.
Locally on each, I can connect and work with the data. I can ping
each computer from the other computer. My problem is that when I try
to connect from one computer to the other I get the following error:
Host 'XXX.XXX.XX.XX' is not allowed to connect to this MySQL server.
This happens on both computers. I can not find the reason for the
error.

Remote MySQL Connection Fails
I have two XP computers, with the same version of MySQL on each. I
have the same database structure and data on each. Each computer has
the same user name, and each MySQL database has the same user names.
Locally on each, I can connect and work with the data. I can ping
each computer from the other computer. My problem is that when I try
to connect from one computer to the other I get the following error:
Host 'XXX.XXX.XX.XX' is not allowed to connect to this MySQL server.
This happens on both computers. I can not find the reason for the
error.

Remote Connection To Mysql Database Using JDBC?
I am trying to set up OpenOffice Base to connect to a remote os x server with mysql on it.

It has the default mySQL JDBC driver class set to com.mysql.jdbc.Driver

It also asks for server URL, should this be the ip address?
Port number? Default is set to 3306.

When I set the class it says that the JDBC driver could not be loaded.

How To Connect To A Remote MySQL Server Using An ADO Connection?
I would like to know how to connect to a remote MySQL server using an ADO connection object, for example from Delphi.

Query Browser When Opened Via Remote Desktop Connection
I have a MySQL database that I set up by running a couple of .sql scripts.

The .sql files are fine and not corrupted.

But they are located on our server in headoffice.  When I try to open them in MySQL Query Browser (also installed on the headoffice server) via Remote Desktop Connection, the Query Browser opens a new script tab but does not display anything (i.e. no text in the scipt tab).

Also, I'm sure this is related, I can enter a query in to the execute box and execute it, but you cannot see the text as it is being typed.  However it is there as when I click the Execute button the query runs fine.

Any ideas why I am not able to see any entered text in the Query Browser window?  I have tried uninstalling and reinstalling Query Browser a few times, but this has not cured the problem.

Making A Command Line Connection To A Remote Mysql Server?
how do i make a command line connection to a remote mysql
server?

for local connections i know it is: mysql -u root dbname

how do i connect to a remote server with a password?

Remote Connection To MySQL DB Server From Client With No MySQL DB
I have MySQL server running on a Solaris machine. I have a Perl tool that is run on multiple operating systems (Linux, Solaris, MKS on windows, CYGWIN on windows). I would like to post to the MySQL database on the Solaris machine from this script when it is run on the different local clients. All these clients share a single network share (available via Samba on windows).

Is there a Perl module that I can install in the network share that I can use to connect remotely to the server DB?

MySQL Remote Backups - No Access To FTP Or Remote Command Line
I have a mySQL database located on a remote host's server. I would
like to schedule a task on my local Windows computer to retrieve a
backup/dump of this remote database.

I have contacted my host, and they indicated that the server is only
open to the Internet via mySQL. Therefore, even if I did have access
to that server's command line (which I don't) to create dumps via
mysqldump, I would not be able to retrieve via FTP.

Does anybody have any ideas as to how I can generate backup files from
my local computer through a local command-line interface? I have done
it through a GUI (DBTools), but I would like to have it done via DOS
batch, so that I can schedule it. Does anyone know of any mysql backup
GUIs with command line switches? Or can somebody recommend an
alternate means of getting a local backup?

Changes Made In One Connection Does Not Reveal In Another Connection At Once.
I use many connection and the same as many threads in my server app to gain performance on a multicpu machine.

Firstlly i call "set autocommit=0" and wrap every statements with "start transaction " and "commit". i use mysql_stmt_execute for every statement rather than mysql_real_execute except those that can't be prepared. The version of mysql is 4.1.11 under Debian linux.

In one connection of one THREAD i insert a row into a table. After i got the sucess code and the last insert id, i then do a "select" from another connection in another THREAD with the "last insert id" return by the previous insert . I expect the select can fetch the row that i have just insert , but some time it does and some time it doesn't.

is there any funtion like "mysql_....flush...cache.." to make the changes from one connection to be reveal to the global at once?

Remote Control
I have MySQL running on a desktop computer that I log into through logmein.com and this is not the best solution. How can I connect remotely to use the MySQL Command Line Client on my desktop so I don't have to wait so long for each line to appear? I should also point out that this computer is on my LAN, so I shouldn't have to configure the router.

One problem I am running into right now is that when I try to make a new table, I keep getting error 1064 (42000) and I'm not sure why because everything looks correct. Code:

Remote Access
I have a MySQL server running on my iMAC and am able to access my databases locally. What steps do I have to do to allow access from a remote PC thru TCP/IP ? The manuals say it can be done but don't specify what is involved.

Accessing Remote DB
i want to inser data into a remote dB. I cant for the life of me get it to connect. The mysql_connect syntax is straightforward. Ive tried the ip number and domain name, the user name and pass are correct. No firewall probs.

Always an error lilke this:
"Can't connect to MySQL server on '130.220.33.14' (10054)"

I use phpdev to run the files at home. Is there maybe a config I have to change on it to access remotely?

Remote Mysql
I'm having a weird problem and hours of googling could not help me solve this, so maybe someone here can help me out? I'm by no means experienced with mysql, it just worked all the time so I didnt have to bother looking into it too much :)

We have 2 servers for our forum, one "powerful" server used as webserver where phpBB runs on, and one server that just holds the database (we got that after we found that code & database on 1 server caused overload).

So far, everything went fine for nearly a year now and I had nothing to do with all of it, all I had to do back then was edit a variable on my.cnf on the database-server I think, and then it worked.

Now the webserver's power unit broke, and after that the database had all these little errors on several tables, so I went to phpMyAdmin, marked them all and clicked "repair" - probably/like/surely a stupid move [my excuse: i was tired & in a rush as I did this from work] as the tables were rather big in size (several hundred mb). As expected, the forums didnt work during that, all I got was the typical phpBB "could not connect to database"-message. This went on for ages without anything happening, the tables just stayed "in use" (I could still connect to phpMyAdmin afterall).

After it wouldnt work, I restarted mysql, i restarted the server - those tables still stayed in use, so I flushed the whole database and installed a backup into another database, changed forum-configuration to read from the new db and thought things would be fine, but they weren't.

It just won't connect to mysql it seems, at first I thought some table must be still corrupted, but after some trying out, I realized that the database/forums DO work when being addressed as "localhost" from phpBB-files running on the database-server. When I change the configuration to connect via the IP of the server instead, it will give me the "Could not connect"-error just as it does when I try to connect from the webserver.

I checked netstat on the db-server to see if the the mysql-port was open and being listened to, and got this:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

this does mean it's theoretically working, right?

I also tried to grant all priviledges again on mysql, but didnt change anything either - do you have any idea what I could do? This is driving me nuts (especially as I can see the forums running fine when connected to by localhost).

As I said - this happened suddenly and has been working before for nearly a year, that's what puzzles me most, I didnt change anything on that server mysql runs on!

Remote OUTFILE
I have three servers (S01,S02,S03)... my aplication PHP run in S01 and there are two databases in S02 and S03.

I make one file and I'm using LOAD DATA LOCAL INFILE INTO tbl_xxx to load file in S01 to S02.

My problem is:

I need export data from S03 to S01 using only mysql.
I'm using SELECT OUTFILE, but this statment is only local.

is it possible?

Remote MySql
I have make a php application and i want to use mysql for the database in different computer, the computer ip is 10.20.37.77 and mysql port 3306, the password = "root"

here is the code

$MySQL_Username = "root";
$MySQL_Host = "10.20.37.77";
$MySQL_Passwd = "root" ;
$MySQL_DB = "squid";
$db = mysql_connect( $MySQL_Host , $MySQL_Username , $MySQL_Passwd ) ;

the error :
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'xeon' (using password: NO) in D:Program

if the php application use mysql in localhost it work
$MySQL_Username = "root";
$MySQL_Host = "localhost";
$MySQL_Passwd = "" ;
$MySQL_DB = "squid";
$db = mysql_connect( $MySQL_Host , $MySQL_Username , $MySQL_Passwd ) ;

Connect To A Remote DB
Is it possable to to have a program on my server that can
access his db?

<?php
MYSQL_CONNECT("http://remotehost.com","db_name","pass_word")
OR DIE("Keine Verbindung zur Datenbank");
mysql_select_db("db")
or die("Didn't work again");

Remote Connect
I've installed MySQL 4.1.12 on my server, I can connect from the local
machine with navicat, but
not from a remote machine. I checked with 'nedstat' and there is something
listening on port 3306.

I have tried several users and settings. What i want is to set a user name
(:support) and that this user
can connect remotely with navicat to the mysql server.
How would I do this? Or what am I doing wrong?

Cannot Log In To Remote Server
I am trying to set up a replication server and cannot get past an error trying to log on to the master from the slave. I have tried everything I can think of and am at a loss as to what else I can check/do. The error on the slave server is:

Error: 'Host 'myslave.mydomain.com' is not allowed to connect to this MySQL server' errno: 1130 retry-time: 60 retries: 86400

The error itself is confusing. Since this is the slave log, the reference to "this MySQL server" does not make sense. I am not (should not be) trying to connect to "this MySQL server" but rather the remote master server. I am guessing that the error is just poorly worded.

I have a user on the master with the host name 'myslave.mydomain.com'. What else is needed to allow that user to connect from the slave host? I tried changing the host name to '%' but that didn't help either. Can someone point me in the right direction?

Remote Admin
how can i remote admin the mysql (i am using mysql 3.23.)
and how can i create users for the remote control (using phpmyadmin 2.2.6)

Connect To A Remote DB
just started a cource in mysql using the mysql db on the instructers
server . Is it possable to to have a program on my server that can
access his db?

<?php
MYSQL_CONNECT("http://remotehost.com","db_name","pass_word")
OR DIE("Keine Verbindung zur Datenbank");
mysql_select_db("db")
or die("Didn't work again");
?>Paul

Remote Server
How I can connect my aplication in delphi with database mysql in remote server?

MyODBC And Remote
I'm conected to server and my app works just fine, and I was connecting to MySQL over ODBC (my app is running on winXP)! It was good while I was using only USERNAME with blank PASSWORD in MySQL! But when I put password, I can't connect, and of course my USER/PASS combination is OK! I try to search for known MySQL bug in this version but with no results!

Remote Login
When logging into mysql, mysql appends '@hostname' to whatever the username you provide is. Example:

> mysql -h hostname -u dsb

'dsb' becomes 'dsb@hostname.com'

Does anyone know how to turn that off so that the exact username specified is used.

Remote Connecting
The admin on my work server won't give me access to the mysql control panel. So what I'm thinking is using my yahoo mysql database instead.
What would I replace for localhost?

$oConn = mysql_connect("localhost", "user", "pass");

Second question, would yahoo allow remote connects?
Third question, will the queries run slowly when remote connecting?


Connecting To A Remote DB
I am running some website on fedora with VMWARE and my main OS is windows server 2003. I am trying to use db on the windows server but whenever I try to connect to it from fedora   I get bug messages.

"Warning !  [2003] - Can't connect to MySQL server on 'ep038' (13)
Server unavailable. Is your MySQL server started ?"

I am sure that the server is started and running on port 3306.
I am sure of the hostname.
I can ping the hostname from fedora so it IS accessible.
I am sure of the login and password (I set them myself).
The weird thing is that when I run a tcpdump, apparently fedora doesnt even try to connect to the remote host database.

Remote Sql Server
I am using PHP on my site and I wanted to play around with myqsql.
Rather than just going ahead and upgrading my account @ a monthly cost for testing, I thought that I would just add mysql on my pc and connect to it from my remotely hosted site.
I opened port 3306 on my firewall.
I can connect to the database but it will not allow me to select the database

Remote Access
I've set up a User account called 'test' for my MySQL database (for use from my Uni). The host value for 'test' is '%' but for some reason I can't connect when accessing the Database from a dynamic dns name.
Test can connect when the JDBC is run using 'localhost' but the connection attempt simply times out when I change the URL to 'bailz.dyndns.org'.
The PC is running behind a router but I can access the web server no problem from outside... it's just MySQL via JDBC that I'm having trouble with.

Windows Remote Gui
I'm looking for a software:
- for Windows
- that would allow me to do everything that phpMyAdmin allows to do
- To connect to a remote MySQL server
- Secure
- FREE!

Remote Site.
i jus completed my first database site and ready to upload. but need to know 2 things.
1. where exactly is the database? ive got my site in the inetpub.. is the database in here C:Program FilesMySQLMySQL Server 4.1 ?
2. how do i upload it along with the site? is there just 1 file to upload or is there lots... ?

Remote Access
I have:

Computer A, my computer, through which I can pretty much install anything I'd like.
Computer B, my webserver, a computer on the network that I installed mySQL, and that uses IIS for its server. It also uses Windows, and not UNIX/Linux.

Anyways. I'm trying to setup MySQL so that I can use it remotely from Computer A, either using it directly with something like SSH or Dreamweaver/PHP. However... I'm completely new at this.

Remote Access
I am facing problem when i try to connect to a remote mysql server using mysql_connect command.

It give error " Can't connect to MySQL server on {IP} (10061) in"

I have even added one user and gave it permission to connect from any host (%) and allowed DB rights too.
I have checked that mysql variable -skip_networking is also off.
There was fire wall installed on mysql server but that has been removed but still problem is not solved.

Connecting To Remote Database
I'm using MAMP on a MacBook Pro. The only database connection I've been able to write that doesn't return an error message is on the database "test" that's installed by default:

$link = mysql_connect ("localhost" , "USERNAME", "") or die(mysql_error());
mysql_select_db ("test", $link) or die(mysql_error());
...where USERNAME is a username I created and accidentally applied to all my databases. Anyway, I assumed I could use the database "test," since I can at least connect to it.

But my queries all display error messages, even after I copy the tables they reference into the database test. Finally, I wrote a very simple query:

$Geog = mysql_fetch_assoc(mysql_query("SELECT * FROM gw_geog_gw"));
But I still get the following error message:

Quote:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /Users/MyName/Sites/Geobop/Files/World.php on line 7

Does that mean I'm not even connected to the database "test"?



Local Version Same As Remote?
I'm setting up a local development environment and wondering which version of MySQL I should be installing. I will eventually upload files to a server with MySQL 4.0.15, should I use this version for my local dev setup, or can I use 4.1.22 without any problems?


Copyright © 2005-08 www.BigResource.com, All rights reserved