473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Remote Connection To Database

196 100+
Not sure if this is where i should be posting this question but here goes anyways;

As the title indicates im trying to setup a remote connection to a database, i have added access for the remote connection; i even made a total wild card for all ip address e.g. *.*.*.* and when i tried to connect it still gives me a connection error, i cannot figure out why, i am pretty certain that the ip address on both ends is correct.


So any ideas or help would be greatly appreciated
Sep 25 '08 #1
6 2482
coolsti
310 100+
For good help, try posting more information.

From what machine to what machine are you trying to make a connection? E.g. Windows to Linux, Linux to Linux, etc.

How are you trying to make the connection? From what application on the computer you are trying to connect from? For example, are you needing to use an ODBC driver for Windows?

What are your error messages?

At the same time see if you have access to any logs or anything that can give you more information. If possible, see if you can connect with the same user information from the machine where the database is located.
Sep 25 '08 #2
Atli
5,058 Expert 4TB
Note that the wildcard symbol for the host part of a MySQL user is %, not *
Like:
Expand|Select|Wrap|Line Numbers
  1. GRANT ... TO 'User'@'%'
That should allow the user to connect from anywhere.
Sep 25 '08 #3
chazzy69
196 100+
Ok to the first question its a linux to linux connection, i have a database on one server, on another completely seperate server i have a .php script which access the database (i know this script works becuase it works locally i.e. on the server the database is hosted on).

Now for the actual error ->

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '#.#.#.1' (4) in /home/content/a/n/g/######/html/#######/########.php on line 6
Could not connect: Can't connect to MySQL server on '#.#.#.3' (4)

Also i regards to the wildcard symbol, i did use the % symbol i just forgot.


I hope this information helps thanks
Sep 26 '08 #4
coolsti
310 100+
If it is a Linux to Linux connection you are attempting, then it may be easier to debug.

Try to open up a terminal window on your "client" machine, and then try to connect to your database on the "server" machine using the mysql command line facility. I would assume you have the mysql client installed on this machine.

The synax is something like "mysql -h hostname -u username -p [databasename]" where username is the mysql username for the connection, the -p will cause the program to prompt you for the password for this username, and the hostname is the net ID of the server machine, e.g. its IP address or known network machine name. I don't think you need to supply the database name for this initially. You should be able to connect and then attempt to select the database to use afterwards.

The point is, if you cannot connect in this manner, then you are not going to be able to connect from PHP. If you cannot connect this way, you may have something blocking connection attempts, like your firewall, or you have something wrong in the username specification. Or maybe the password, since I believe the mysql console client prompts you for the password before trying to make the connection.

If you can indeed connect this way, then you can look in more detail in your PHP connection calls, as the problem then must be there.
Sep 26 '08 #5
chazzy69
196 100+
I don't thik i can connect using that method due to the fact im currently using remote hosting, so i don't think i can open terminal windows??

Any other ideas thanks
Sep 28 '08 #6
coolsti
310 100+
I don't thik i can connect using that method due to the fact im currently using remote hosting, so i don't think i can open terminal windows??

Any other ideas thanks
Not really sure what you mean here. Are you working on a Linux machine? What do you mean by remote hosting? If, for example, you are working on a remote Linux machine from another local machine sitting in front of you, either LInux or Windows, then you can do what I suggest.

For example, if you are working on Linux remotely from Windows using a putty.exe window, then you have the window right there where you can invoke the mysql command to attempt a connection. Same actually if you are working on a remote Linux from a Linux machine. You can attempt to connect to your "server" machine database from your "client" machine database from a Linux operating system (which has the mysql client software installed on it) simply by calling the mysql command (with proper arguments as described in my previous post here) from the command line in a shell window. It does not matter whether that shell is a remote shell from a Windows of another Linux machine.

You could try the same from a Windows machine directly using a Windows command window if you have the Windows version of the mysql client installed on your Windows machine. I believe there is a Windows port.

Or perhaps I don't understand what you mean with the problem "you are using remote hosting". If your "server" machine is a Linux machine located at a remote internet provider, that does not matter at all. I have had no problem making a connection with the mysql command from my home machine to my database on my internet provider, as long as I give the correct arguments to the "host" and "username" parameters, and then provide the correct password when prompted. Again, any firewall you have on your PC must allow such a connection (maybe it does per default, but if you get stuck here, check your firewall).
Sep 29 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: kackson | last post by:
Hi. I would like to access my database outside of my company. I read many documents but they are all pertaining to accessing the database via ASP or some form of web application. Is there no...
4
by: GAVO-UK | last post by:
Hello everyone. Using Access 2003 and MSDE I just started experimenting using Access as the front end for SQL using *.adp, and would like to connect the front end to the back end remotely,...
3
by: Hrvoje Vrbanc | last post by:
Hello all! Scenario: - web server at one location (domain) with VS 2003 - SQL server at a remote location (domain) - VPN connection on port 1433 between the two domains I have no troubles...
5
by: Mitya Mitriev | last post by:
Hi I created ASP.NET 2.0 web application that uses SQL Server 2000 database and it works perfectly when website and Sql server were on local machine. Then I installed application on production...
10
by: cleo | last post by:
I am migrating from VB6/Access to Visual Basic and SQL Express. I have success writing test code on my local machine and am now setting up tests for deployment to a server. I have installed SQL...
2
by: Tor Inge Rislaa | last post by:
Database on remote server On the remote server where my ASP.NET application is located there is no SQL Server or SQL Server Express. When I test my application locally it works fine because...
4
by: Noy B | last post by:
Hi, I have developed a small application that is using a MSAccess DB. the problem is that it was developed on a machine where the application and the DB are both located. now it needs to be...
8
by: BD | last post by:
I am developing C# win form app to work with remote database on SQL Server 2005. Problem scenario is as follows: 1. a form is open that has downloaded dataset to local cache 2. computer is...
3
by: Me LK | last post by:
I did a search but could not find an aswer that worked so here it goes. I just did an upgrade from 2003 to vs 2005 express. I am using a remote sql server 2000. I specifically upgrade to make...
5
by: Cirene | last post by:
I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm using, webhost4life. NOTE: I HAVE deployed other SQL Server sites to the same account with no issues. Now I'm getting...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.