Connect Page (local) To Remote Database:
I'have Easy PHP in localhost and i need connect php page (local) to remote
database:
$db_host = "62.149.225.23";
$db_user = "gfo";
$db_password = "gfo";
$db_name = "gfonline";
$db = mysql_connect($db_host, $db_user, $db_password);
The browser show this message:
Warning: mysql_connect(): Can't connect to MySQL server on ེ.149.225.23'
(10061) in e:phpgfonline.itprovaremoto.php on line 7
View Complete Forum Thread with Replies
Related Forum Messages:
Can't Read Remote Web Page From Local Apache/PHP
I'm trying to read the contents of any Web page on another host. I'm finding that... echo file_get_contents( 'http://www.php.net' ); .... works fine if I upload the PHP script to my Web host, and run it there. But if I run it on my PC, which is running Apache 1.3.33 (Win32) and PHP 5.0.5, then it always times out, and gives me the error message... [error] PHP Warning: file_get_contents(http://www.php.net) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. I get the exact same results using... $fh = fopen( 'http://www.php.net', 'r' ) or die( $php_errormsg ); while (! feof($fh)) { $page .= fread($fh,1048576); } fclose($fh); echo $page; Anyone know what could cause this to happen?
View Replies !
How To Connect To Remote MySQL Database
I have mysql running on a linux box. I have apache (2.0.4) running on a diff linux box. I have php 4.X. I can connect to the mysql db using odbc from a windows box, but cannot connect to the remote db from web server box (linux) to mysql database (another linux box). Apache is on RH Enterprise 3.0, mysql is on slacware (2.4.22 kernel). I am using php, require_once('DB.php'), and the dsn style connect string: "mysql://username:password@dbhost/test" Always get an error :"unknown database" How do I verify that my php is set for mysql? and any ideas on why I cannot connect? PHP and Apache were the product as it came with RH Enterprise 3.0ES. I have made no changes to PHP or APACHE. Maybe I need to?
View Replies !
Dreamweaver Connect To Database On Remote Server
I'm using DW to connect to a database on my remote host. Connection name: MySQL Server: localhost Username: myusername Password: mypassword Database: It gives me the options to select a database, but I can't quite figure out what I should have for my connection name. Should it be the url of the site, the directory?
View Replies !
How To Connect Remote Site - Can't Connect To MySQL Server
Lets say, i have two php sites named Site-A and Site-B. I want to use MySql Datbase of Site-B for Site-A. Generally i use : $Host="localhost"; $User="username"; $Pass="password"; $DB="databse"; mysql_connect($Host,$User,$Pass); mysql_select_bd($DB); When i connect to Site-B database from Site-A what will be the $Host name? I have tried with: $Host="www.mysite.com"; but it shows the warning: Warning: mysql_connect(): Can't connect to MySQL server on....
View Replies !
Could Not Connect To MySQL: Can't Connect To Local MySQL Server Through Socket
To connect to a MySQL database, hosted on my machine, an iMAC G5 with OS 10.4, I am using the following code: $dbc = mysql_connect ('localhost', 'guestuser', �') OR die ('Could not connect to MySQL: '.mysql_error() ); However, I receive an error message: Could not connect to MySQL: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2). MySQL server is running, and user name/password are valid.
View Replies !
Connect To MySQL - Can't Connect To Local MySQL Server Through Socket
I've finished coding php, run it localhost and uploaded to my Apache server with Linux OS. However, I'm seemingly unable to connect to mysql at the server side. and received the following message: Could not connect to database: Can't connect to local MySQL server through socket '/tmp/mysql.sock'(111) What's this message abt? I tried to get into MySQL without php on the server. and received the same message at the console.
View Replies !
Remote To Local DB Sync
help me with regards to an efficient way in which to synchronize a localhost MySQL DB with a remote MySQL DB? I cannot use any 3rd party software as my host does not allow external access to the remote DB.
View Replies !
Can't Connect To Local MySQL Server Through Socket
I created a test web form, that successfully input the data into my test database. However, today I created a second form, added the layout code, putting the layout and mysql connection details into a php include code. These are the only changes I have made, apart from field names etc, but today, I get the following error message: QuoteWarning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/fhlinux177/f/further-flight.co.uk/user/htdocs/napsters/enter.php on line 50 Warning: mysql_query(): A link to the server could not be established in /home/fhlinux177/f/further-flight.co.uk/user/htdocs/napsters/enter.php on line 50 Your nap has been added to the database. Good Luck! I checked, but the nap hasn't been added to the database. I use the code I found on phpmac.com. It currently looks like this: Code:
View Replies !
Printing To Local Machine For The A Remote Site
I would like to find out if I can get a page to print on a printer physically next to the server when a user of my site clicks the submit button. I'm sure that there's a way, but being new and slightly slow I'm not sure where to even begin looking.
View Replies !
Cant Connect To Remote Mysql Db
I have a db on Server A. Server B is on the same network, different IP. Server B connects to the db correctly through my php script. Server C is on a totally different network. Using the same script as was used on Server B, I'm unable to connect to Server A's database. Access hosts on Server A has been configured as % to allow connections from anywhere. I can connect to the db from my local computer using SQLyog just fine. Both Server B & C are running php 4.4 Any ideas as to why the script will not connect on Server C?
View Replies !
Warning: Mysql_connect(): Can't Connect To Local MySQL Server Through Socket
A friend sent me a PHP script he uses to manage data. He wants me to do some minor changes on some of the tables. He sent the binaries , the database dump and the php files in a tar file. I set up a database for testing on my server. I ftp'd the php files to my server. When I try to access any of the php files I get this... Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/m/e/n/menlo/html/pmtool/goremote/common/CommonLib.php on line 130 Failed to connect to the database ..! Do I need to do something with the database dump?
View Replies !
Download Files From Remote Server To Local Webserver
I am trying to create a php page whereby people can download files from a remote server to their own server (to update their webdirectory with updated files/images etc). So for example one php page (e.g. update.php) should be able to download files from a remote server to a specific directory on their local webserver. Is this possible?
View Replies !
Date Function On Local Server To Remote Host
This little combo was giving me Sunday, April 30 on my local server and Thursday, April 1 on my remote host, and I can't for the life of me figure out why. I could swear it used to work. PHP Code: $today = gmmktime(0,0,0,date('m,d,Y',gmmktime())); echo gmdate('l, F j', $today); (The first function gives me a "midnight" time stamp, so all dates put into the db, and compared to it, are consistent). When I rewrote it thus, it worked fine on both hosts: PHP Code: $m = date('m',gmmktime()); $d = date('d',gmmktime()); $y = date('Y',gmmktime()); $today = gmmktime(0,0,0,$m,$d,$y); Any idea what the heck is going on?
View Replies !
How To Connect MSSQL In Remote Server
I try to connect my mssql DB in remote server from localhost. But it fails to connect. The connection succeed only if i connect a mssql DB present in localhost. I can guess, this is due configuration settings in MYSQL my.ini But i dont know what necessary changes to be made inorder to connect a mssql DB in remote server from the localhost.
View Replies !
Can't Connect To Remote MySQL Server Using PHP
i am trying to connect to a remote mysql server through php. Here's the code: mysql_connect("my.hostname.edu", "username", "password") or die (mysql_error()); mysql_select_db("db_name") or die ("unable to select db".mysql_error()); $r1 = mysql_query('SELECT * FROM table') ; Using the mysql prompt on the remote server, the mysql -h -u -p works just fine with the parameters i've specified here. According to the user table I have the proper permissions. I just can't figure out what could be preventing the connection here, although I am no expert...can anyone help?! BTW, I am using PHP 4.4.1 and mysql 5.0.
View Replies !
Connect To Remote MySQL Server
I have a fully functional page hosted on my PC that uses PHP and connects to MySQL on my PC to generate it's code. I now have some web hosting available which includes both PHP and MySQL support, however the webhost is still in the process of getting the MySQL support activated and functional. I therefore have uploaded my webpage to the host and edited the webpage code to access the MySQL server on my home PC - once the host gets MySQL working then the webpage will of course use the MySQL that my host will provide. The original code in my webpage to connect to MySQL is: $panorama_database=mysql_connect(localhost,$userna me,$password) or mysql_fail("Unable to connect to MySQL database."); I have edited this to: $panorama_database=mysql_connect(.207.???.???: 3306',$username,$password) or mysql_fail("Unable to connect to MySQL database."); (My IP masked by ?). And it's works no problems - however i have a dynamic IP address and wish to replace the hardcoded IP address with an alias from www.no-ip.com. So i tried both: $panorama_database=mysql_connect('http://mynoipalias.no-ip.org:3306',$username,$password) or mysql_fail("Unable to connect to MySQL database."); and (with no port specified): $panorama_database=mysql_connect('http://mynoipalias.no-ip.org',$username,$password) or mysql_fail("Unable to connect to MySQL database."); Both attempts to use my www.no-ip.com alias fail and i'm not sure where to look for logs to debug the problem.
View Replies !
Cannot Connect To Remote MySQL Server
Ok, I have done this MANY times before without a problem - so I don't know WHY this isn't working! I am in the process of moving to a new server - so I am updating my mysql_connect statement to use our NEW server instead of the current one (@ localhost). I went into MySQL on the NEW server an added two new users - same username - one for the domain name of our current/old server and one for the IP address of our current/old server ... and gave the users the appropriate rights. I then updated my "mysql_connect" statement to point to the NEW server... but I get the following error:
View Replies !
How To Connect To Remote Mysql Db Set Up For Ssl Connection?
the remote db is set up and privileges have been set for the user acct to connect to it: GRANT ALL PRIVILEGES ON myDB.* TO 'myUser'@飓.123.123.123' IDENTIFIED BY 'secretpassword' REQUIRE SSL; When I try to connect, I get the "mysql_connect(): Access denied for user...(using password: YES)" error. What's the command to connect via ssl? Also, just to confirm, if 123.123.123.123 is the IP of the Apache server which is serving the website, having 123.123.123.123 for mysql in the hosts.allow file on the server hosting the db is enough, right?
View Replies !
Copying File From Hosted Remote Sever To Local Machine
I am trying to use php to automate the copying of a file from my remotely hosted directory to my computer. I have put together the following but it will only do the copying from one directory to another on the remote server. Reading the postings on these functions they suggest that it can be done but it appears to be the case if your are hosting your site on the same machine you want to copy the files to. Does anyone know if there are functions in php to do the transfer from remote server to my machine or if the code below will acheive this with modification? <?php $ftp_server = "xxxxxxxx"; $ftp_user = "xxxxxxx"; $ftp_pass = "xxxxxx"; $local_file = 'myfile.txt' $server_file = 'myfile.txt' // set up a connection or die $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass); // check connection if ((!$conn_id) || (!$login_result)) { die("FTP connection has failed !"); } // try to change the directory to myfilesdirectory if (ftp_chdir($conn_id, "myfilesdirectory")) { echo "Current directory is now: " . ftp_pwd($conn_id) . ""; } else { echo "Couldn't change directory"; } if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) { echo "Successfully written to $local_file"; } else { echo "There was a problem"; } // close the connection ftp_close($conn_id);
View Replies !
Php MySQL Works On Remote Server, Only Partially On Local Server
code to populate form select fields with data from a MySQL database, so a user can use those to sort/filter and view the 3,000 records. No inserts -- just selects; very simple. I originally set this up using URL-based query strings at http://stjuliana.org/school/ar/BUindex.php but since that only allowed sorting and not filtering, hence all 3k records load, I made a form verson at http://stjuliana.org/school/ar/index.php . Everything works just fine, however, there's still a lot of tweaking I want to do, such as splitting the form input and output into two pages (_blank), having a printable version, etc. To that end I just set up the latest builds of Apache, php and MySQL on my local Windows XP box, lest I blow my beer budget for the month on bandwidth overage. <g> I have a very simple page I used to test my localhost setup and everything's fine. I can connect to MySQL, create, insert and select from DBs, so I know my config is fine. All my other .php pages on this site work fine locally as well. The two abovementioned pages, however, are giving me fits when run locally... For the URL-query-string version, it loads up with the default view (=name_ns), which grabs all records and sorts by name and point asc. No matter which of the other sort 'views' I might choose, it still loads up all the records in that default sort. The server's holding on to something and I don't know how to clear it. The remote version correctly sorts based on the query string chosen. The form version is worse. It connects to the DB and populates the select boxes with the field data -- that part's fine. But no matter which submit button is selected, no data is retrieved. I get no error, but no data either. The form's action is set to $_SERVER['PHP_SELF'] and I've tried both GET and POST -- no change. Since the exact same pages work on the remote server I know it has to be something on the local setup. But where do I look if there's no obvious error? This is probably something incredibly basic but I'm bleary-eyed from reading tutorials and forums all over the Internet and can't come up with anything.
View Replies !
Connecting To Local Database
I'm not sure if this is possible. I would like to have a PHP app on the Internet connect and write to a local database (Intranet). For example, users would go to a web site http://www.internet.com to run the app. The app requires an internet connection and is outside of the user's network. The app would have the option to either store data locally or on the Internet. I would like to give users the option to store data locally because some may hv privacy/security concerns if the data is stored on the Internet or kept/maintained by another company. Would the connection string below work from the Internet to connect to the user's local database? I don't have my web hosting service up yet so I can't test. <?php $server='localhost' //or whatever the client db server name is $c=new mysqli($server,'user','passwd','db'); ?>
View Replies !
Cannot Access Local MySQL Database
I'm having a huge problem getting PHP on IIS to access the MySQL server (running on the same server). I get a 10061 error when trying to issue a simple connect: Warning: mysql_connect(): Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061) Username, password and IP are correct - and the MySQL server is actually running and working perfectly. I can access it just fine from the same server using ASP or my home Linux box running PHP 4.3.8 on Apache. Let me clarify that: The EXACT same mysql_connect command works from my (remote) Linux/Apache box, but not on the (local) IIS server. The server I'm having trouble with is running IIS, PHP 4.4.0 and MySQL 4.0.22-nt. PHP is running in CGI mode and reports MySQL Client API version 3.23.49. Anyone have a clue what my problem could be? I've just about googled myself to death on this issue. It seems that basically the only advice I've found is that people need to make sure MySQL is running (it is), that the username/password is correct (it is), that the correct port is being tried (everything at default, so it is) and that a firewall isn't blocking the request (it isn't).
View Replies !
How To Get Data From A Database To My Local Machine?
I have a process that runs on my local machine which requires information from a database to be used in a dos batch file. Currently, I have a setup where a query string is sent to the web server with the id number of the record I want to get and a page on the web server writes a file to the server which is then downloaded using httpget to be used by the batch file. Is there a better way to do this? In other words, how can I have a dos batch file interact with the database directly to get the info in the record?
View Replies !
Backing Up The Database On Local Machine.
I'm currently getting on with the security checking of my site, but how about backing up the database. Currently I'm using a hosted service, so all my data and code is on the internet. I have only one database online with multiple tables, so I need to put them somewhere (on an daily basis preferably, with new backups each day). The code I can handle it's just the databases that are tricky. Is there any tool out there that'll do this quick and smart and would I need a local MySQL database running in order to put them on a local machine.
View Replies !
Transferring A MySQL Database From Local PC Onto An ISP Server
If I have an MySQL database on my local w2k, how do I transfer it onto my ISP server? The ISP gave me the name of an empty MySQL database they set up for me, the username and the password with no further explanations. I came here from ASP/Access where I was just uploading a mdb file into my webspace. But with MySQL there should be a different procedure,
View Replies !
How To Connect On MS SQL Database
How can I connect to a MS SQL server using PHP running under LINUX on different machine?..so u see, I have an NT server (where my MS SQL server is installed) and another server where I installed my MySQL and PHP (this is under Linux)..so is there a way to access Ms SQL via PHP ? if so, how can i do it? so they say i need to download an odbc driver?
View Replies !
Database Connect
I know this is so easy and I am just being retarded but if i created a database in mysql and want to make it accessible to a web page form i created and posted on my site what do i have to do iwth the form to access the db
View Replies !
Connect To A Database
how to create memership sitesyou know where people can sign up, and a page is displayed based upon what they entered username and password etc. so far, I know how to use php to submit a form to email. But that is It. I'd really like to learn php syntax, and be able to connect to a database. I have asked programer friends, to help me, but they are too busy. Does anyone know of someone who could help, or perhaps there is a site I could go to?
View Replies !
Cannot Connect To Database!
When I run my php script it returns a page displaying "Unable to Connect", clearly this is created by the line in my script below: $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!"); The thing I can not understand is why it will not connect I have checked and rechecked the values I have entered for the $host $user and $pass variables. I know they are definately correct because I use the same values to log into SQLyog with no problem.
View Replies !
Connect To Database
Am running PHP5, apache 2.0 and using a framework called zebra to do some work on my local machine which has phpmyadmin and PEAR and all that jazz. Everything works fine, including my query but I can't seem to connect to my local DB for some reason. All the parameters for $db->connect are fine as far as I can tell but the machine won't let me in.
View Replies !
Connect To My Database
both mikespc and petespc and anyone we allow on the internet can connect to EasyPHP server i.e. permissions have been set mikespc can enter petespc/mysql/ in a browser and request for password etc. comes up and all works fine Navicat on mikespc recognises the mysql server but will not connect We use Hostname: petespc/mysql/ and Port: 3306.
View Replies !
Link To Local Files Through A Dynamic Page
I decided to flesh out my php skills by building a web application which could scan through local files on my intranet (specifically mapped drives on my server) and generate a list of Movies or pictures or music, etc. Which worked fine, I created the code to do that and to store the results in a mysql database. I can even print it out to a ..php page and sort it however I like. What I can't seem to do is to create links to the data I've indexed in a way that will let me open them from the generated php page. I've searched and searched and there just doesn't seem a way to do this. I'm pretty sure I've exhausted the obvious options. The following trials did not work when the document was served from an apache web server. <?php echo "<h1><a href=file:///c:/temp.txt> HEY </a></h1>"; echo "<h1><a href=file:///c: emp.txt> HEY </a></h1>"; ?> <a href=file:///c: emp.txt target="_top"> temp.txt </a> <a href=file:///c:/temp.txt target="_top"> temp.txt </a> When the same page was loaded directly from the file instead of served through apache the bottom two links worked. This doesn't really help me however. I need to be able to dynamicly generate pages that link to the files. I've read that browser security is the restricting factor in this but changing all of my security settings in IE to low didn't seem to affect it (not sure what the equivalent of security settings is in Firefox). Does anyone know of a way to link to local files directly in a way that lets you open them directly from the source instead of by downloading them to a temp file or saving the file to somewhere locally? Is it even possible in PHP?
View Replies !
How To Print The Local Variables Used In A Generated Page
I am still a beginner of PHP, and while I found out the way to print all the variables passed as a POST, I was wondering (for debugging purposes) if there is a simple way to tell the PHP interpreter to print out all the variables that have been used during that session, without storing anything anywhere, and without buying a commercial tool.
View Replies !
Using Php To Connect To Access Database
First of all I'd like to appologise if this has been posted before, I did try the search, but for some reason instead of result, all I got is a blank screen (did try waiting to see if it was still searching/loading). I've done some basic php a while ago, but have now been asked to create a php script to query an msaccess database that is running on a WinNT server running IIS. I've looked around on the internet and have found code similar to the code below. My connection is the name of a system or file ODBC data source. However much I play around with this (such as putting the database path in where "myconnection" is) but I can't seem to get it to connect to the database I get the "Unable to open database" on my page. <? $db = 'myconnection' $conn = new COM('ADODB.Connection'); $conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db") or die ("Unable to access database");
View Replies !
Connect To Oracle Database
I am running a PHP script on unix. I am trying to connect to Oracle database. Before i start using the functions like Ora_Logon etc, what steps do i have to take in order to make PHP talk to Oracle database?
View Replies !
Can PHP Connect/use An Access Database?
I was trying to connect to an Access database (something.mdb or something), but I realise I was using the all familiar MySQL way of doing it, so naturally it didn't work.. If PHP can use this mdb files that Access uses, can anyone tell me how I can utilize them.
View Replies !
|