Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I want to make connection between my database on the server,that located on the internet and my application that runs on some client.
My application based on .Net framework and i using MySql Connector for .Net component.
After some searches i gain the server address for the server by execute php command below :
echo $_SERVER['SERVER_ADDR'];
And this command returns : 67.225.166.81
I can connect to database with php when the php files runs on the server.
I used the values for connection in my .Net win app and this is the connection string :
string connStr = "server=67.225.166.81;port=3306;database=navayeme_joomfa;user id=navayeme;password=*****;";
The win app trying to make connection and an exception thrown :
Authentication to host '67.225.166.81' for user 'navayeme#myclientIP' failed ...
The myclientIP is ip of my client.
How can i fix this problem?Is possible the server doesn't support for this type of connection?
Using MySQL database together with a php script run on the same server does not mean that you can connect to the MySQL database from another network. PHP runs without a problem because it can make connection to the MySQL server on server using either
regular TCP connection (locally)
UNIX socket files
Please check that MySQL accepts connections on port 3306. If firewall is used, please make sure that 3306 is allowed for incoming connection.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I'm writing a desktop application (in Delphi). I would like to connect to MySQL database on a server. Up till now I tested my application using MySQL installed on my local computer. I used ODBC connector and all tests went successfully. Problems have started when I tried to connect database on server via ODBC. I'm getting connection failed message all the time and I cannot do anything.
Please tell me, how should I connect to this MySQL?
By default, mysql listens for incoming connections on port 3306. Use can use telnet to test if a networking problem or firewall is preventing you from connecting to the server that MySQL is running on, using the following command:
telnet fqdn.of.mysqlserver.com 3306
If successful, you should see that it connects, followed by some encrypted gibberish from MySQL. If it doesn't connect, then the problem is a firewall, a networking problem, the MySQL server is unreachable, or something else blocking the connection.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I cannot conect to Mysql server remotely, access granted to user from any host and mysql server is running. I can access locally using 127.0.0.1 but when I try to connect using machine's IP it gives me error "Can't connect to MySQL server on '192.168.1.102 (10060)'". I searched a lot couldn't sort this problem.
You shoudh check foll steps
MySQL is listening on public IP (sounds like you've done)
MySQL is listening on standard port / you're connecting the same port it's listening to.
Is there a firewall running on the remote machine? (They usually are packaged standard in distros) Is the firewall configured to allow connections to that port?
If the remote machine is within another network, is there network address translation (NAT) going on between your connection and the end machine - if so, is it configured to allow the MySQL port through.
Is the my.cnf file configured to allow connections from anything other than localhost 127.0.0.1 IPs - although you'd more likely get a access denied response, than a cannot connect.
please check your mysql config file, disable
bind-address = 127.0.0.1
first ping the server ip, if reply you can try this :
reconfigure mysql server instance , allow connect from remote machines
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am using a mysql server on my linux ubuntu 10.04.
Everything is working fine, when I use example.com as the mysql server name.
When I use www.example.com as the mysql server name, the connection does not work. Where can I change the settings.
The URL of my website is working with www and without.
Is the mysql server name a setting in the mysql configuration or is it the hostname of my domain?
You can check your MySQL servers users table. When you see the user, edit it and set this value for the host he/she can connect to:
%example.com
The % is a wildcard for everything in front of "example.com". The second alternative is to add a new user<->host combination via CREATE USER http://dev.mysql.com/doc/refman/5.1/en/create-user.html
BUT ATTENTION: You should never, never, never connect to your MySQL from outside localhost. And if so, use an SSH Tunnel to do so.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have installed SQL Server 2008 Management Studio and am able to login to the database through this. I have also installed the SQL command utility. But, am unable to login through the command utility. I get the following error:
C:\Users\Administrator>sqlcmd
HResult 0x274D, Level 16, State 1
TCP Provider: No connection could be made because the target machine actively re
fused it.
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A
network-related or in stance-specific error has occurred while
establishing a connection to SQL Server . Server is not found or not
accessible. Check if instance name is correct and i f SQL Server is
configured to allow remote connections. For more information see SQL
Server Books Online.. Sqlcmd: Error: Microsoft SQL Server Native
Client 10.0 : Login timeout expired.
I tried giving the server name, username and password explicitly using:
sqlcmd -S <hostname\database instance> -U <user> -P <pwd>
this too doesn't help.
I need this command utility for my automation stuff. Please help me!
At first blush, it sounds to me like your SQL Server Management Studio is connecting via a different network library, such as Named Pipes, while the sqlcmd client is attempting to connect via TCP, and the server isn't listening there (or perhaps on a non-standard port). That's why you're getting the TCP error in the latter instance.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
Improve this question
I'm trying to connect to a named SQL instance on the server.
There is already default instance of SQL Server 2005 and a newly named one - SQL Server 2008. I'm using the "Network library" property to use TCP connection but for some reason, he try's to connect the default instance and omit an error about login error.
If I remove the network library propery the connection established as well without any error.
I'm using windows authntication and have all the permissions needed.
The problematic connection string:
Data Source=ServerName\InstanceName,1433;network library=dbmssocn;Initial Catalog=MyDataBaseName;Integrated security=SSPI
The working connection string:
Data Source=ServerName\InstanceName;Initial Catalog=MyDataBaseName;Integrated security=SSPI
Omitting the ,1433;network library=dbmssocn from the connection string makes the difference. adding it maked the server to connect the deafult instance.
Both of the server allows remote connections.
I would like to understand why, please.
Thanks in advance,
Tamir
Copied from my answer on your question on ServerFault...
The connection strings have 2 differences so I'll try to answer for this...
Named instances do not listen on port 1433 (only the default instance by, er, default)
The instance name is ignored when the port is specified
So:
ServerName\InstanceName,1433 means connect to server "ServerName" on port 1433
ServerName\InstanceName means connect to server "ServerName" and resolve instance name to correct port (resolve uses port 1434 UDP)
However, network library=dbmssocn means use tcp. It could be the SQL Server instance (see port stuff) does not listen on tcp
At a guess the 2005 and 2008 instances would be listening on different ports. Perhaps you need to set the connection string for the SQL Server 2008 instance to the correct port; you could be hitting the SQL Server 2005 listener and asking it for an instance that is not present on the 2005 installation.
What port is the SQL Server 2008 instance listening on - This article discusses the subject. and has a powershell script that actually interrogates the system to find out what port the DBMS is really listening on. It also talks a little about where this config lives in the registry.