5

I need to connect my online mysql database from local wamp/xampp server using php

I need to update some table in my online phpmyadmin database from my local phpmyadmin database , It is possible ? my local machine have internet connection ,

3
  • Are you using cPanel ? Commented Nov 3, 2013 at 4:01
  • my online phpmyadmin database - if you're using phpmyadmin on the server anyway - why not just use phpmyadmin on the server ..? What's the purpose of what you're asking? Commented Nov 3, 2013 at 13:45
  • Yes , I am using cpanel , i need to update my local database table to my current online cpanel phpMyadmin database, how i connect the another online PhpMyadmin database and local machine Php Myadmin database Did you have any php scripts for this solution ? Commented Nov 3, 2013 at 14:13

3 Answers 3

2

To connect to remote server from your local machine you need some already granted privileges on that server itself with your IP and an username with a prespecified password. So you can't do it without their permission.

Check this answer

After that you are allowed to create connection to that remote database server using the following syntax:

$hostname='www.facebook.com';// Remote database server Domain name.
$username='username';// as specified in the GRANT command at that server.
$password='password';// as specified in the GRANT command at that server.
$dbname='testdb';// Database name at the database server.
$mysqli = new mysqli($hostname, $username, $password, $dbname);
Sign up to request clarification or add additional context in comments.

2 Comments

I need to connect Mysql Database using php ,
If i am putting permission to my online PHP Database its showing error message
1

If your database is on a Shared Server Hosting. Some hosting providers does not allow you to connect to your databases remotely.

Here's a quick walkthrough of how to do a remote connection to your database.

1 Comment

Thank you , Have any more idea to slove my problem?
0

Try downloading SQLYog (Community edition).

http://code.google.com/p/sqlyog/downloads/list

It's good for this sort of thing, if you can get to the remote host on standard mysql port 3306. If you're going to connect from php on your local machine, you'll probably go through the same port using one of the php libraries to the remote machine with one connection, and to your local database with with another connection. The tool will let you verify and test the connections and test the queries interactively.

2 Comments

This does not seem to be an appropriate answer - the author needs to change/verify connection credentials in his local machine (i.e. that's the problem/question) and instead you've proposed to use a (not free) different tool which will have exactly the same question/problem.
The Community Edition is free. One way or another, he needs to test the connections, and view the configuration settings and tables. The question seems to be how to connect to both. I don't think phpmadmin supports multiple simultaneous connections. Or even sequential connections with much ease. Of course he still has to do the work himself. It's just a tool that lets you compare and copy from one to another.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.