I have created database and user and give all the privilege to the user.When i give the IP as Database host.It will show the following errors.Giving hostname as localhost it will work fine.
I am using phpmyadmin 3.3.2...
The error message is given below.
Failed to connect to your MySQL database server. MySQL reports the following message: Can't connect to MySQL server on '192.168.85.10' (111)
It seems that the IP address you use is your "external" IP and not the IP localhost would resolve to, which is most of the time your loopback: 127.0.0.1.
So if you are trying to connect from the same computer as the database is running you should use 127.0.0.1 as the IP address.
If you are trying to connect to your database from another computer on the network, you should enable MySQL remote access in your my.conf (MySQL config file). Because by default MySQL disables remote incoming connections.
You do this by setting the "bind-address" line to your real (external) server IP as such:
bind-address = 192.168.xx.xx (assuming its on your local network)
Or put the bind-address in comment.
Also make sure that the skip-networking option is commented as such:
#skip-networking
And then restart your MySQL server.
Now also make sure that your MySQL users are also allowed to connect from locations other then "#localhost".
I hope this helps!
Cheers,
Timusan
Related
In my Azure portal I created the resource "Azure Database for PostgreSQL server". I set up the firewall to enable two Virtual Networks (in order to allow the correct functioning of two applications) and the IP address of my local computer (in order to be able to work on the database using DBeaver as client). This has worked for several months although, since I have a dynamic IP address, I often have to change the enabled address. Now I'm trying to update it but, when I try to connect to the database via DBeaver, I get the following error:
FATAL: no pg_hba.conf entry for host "XX.XX.XX.XX", user "myuser", database "mydatabase", SSL on
where "XX.XX.XX.XX" is exactly the IP address I have enabled in Azure.
I tried to install a second Client (pgAdmin) but I get the same error. Also, since my applications that use the database seem to work properly, I tried to verify the connection data that I use in DBeaver (host, database, user, password) but they are all correct.
In Azure, in the "Connection security" tab of my database (see image below) I read the following warning:
Some network environments may not report the actual public-facing IP address needed to access your server. Contact your network administrator if adding your IP address does not allow access to your server.
So changing the IP address has no effect? How can I solve the problem?
I solved the problem by restarting the database: https://learn.microsoft.com/en-us/azure/postgresql/howto-restart-server-portal
In the Azure Portal change require_secure_transport from server parameters to OFF.
make ssl connection non mandatory in server parameters for postgres service in azure, its dynamic parameter so no postgres service restart not required
or fix/configure application to use secure(ssl) connections only
I am trying to connect Excel to my companies database but am running into problems because we use an SSH tunnel. The SSH tunnel connects to Nexcess which is where our servers are stored.
Has anyone else encountered this problem?
Any help is appreciated. Thanks!
Use putty, set up your SSH link to the server.
Under auth select 'allow agent forwarding'
In tunnels set source port to 3306 and then put the domain of your mysql server in the destination followed by :3306 (update this port number if your mysql server is on a different port obviously, but keep the local port the same)
Connect
In mysql workbench, add a new connection: localhost, port 3306, user / pass etc
Then from excel, connect away
I am trying to connect to CloudSQL DB from Informatica server which is inside a corporate proxy. I have got the Public IP of the server and added to authorized networks.
But unable to connect to server still and tried CIDR notation to add whole all IP's ..*.0/24.
Is there anyway in CloudSQL to get connections which are getting refused, so that it can be added to Authorized networks.
Did you assign an public IP to your instance? This is necessary to be able to connect over the internet.
Can you create a new GCE VM to connect?
create VM with ubuntu image
run sudo apt-get install mysql-client
whitelist the VM's IP address in Cloud SQL
use the mysql client on VM to connect
To answer your question, "Is there anyway in Cloud SQL to get connections which are getting refused, so that it can be added to Authorized networks."
You can whitelist everything with "0.0.0.0/0" and "::/0" (IPv6).
There is no way to see a log of the IP addresses of rejected connections. The IP address you should whitelist is usually what you see at ip4.me.
If whitelisting is the problem the error message should be "Lost connection to MySQL server at 'reading initial communication packet'". If you get a different error message you may be connecting to the wrong IP address, may not have an IP address assigned to your instance, or might have a corporate firewall stopping outbound MySQL connections (port 3306).
is there any way to connect to a remote database by using SQLyog? I have the ip address, user name and password of the database. However, I have 'Error 2203 - Can't connect to MySQL server on '[myIpAddress]' (10060)'` whenever I test connection in SQLyog.
It means there is no direct access to database ..
You can check by telnet to port 3306 from destination address.
You can connect to MySQL remotely using SSH, if the remote MySQL connection is not enabled. Please check the following screenshots:
In my development shop, we deploy code on virtual servers that sit on a remote network.
We access the machines on that network by first opening an SSH connection to a gateway server, and then SSH-tunneling RDP over a local port.
I would very much like to be able to locally access SQL Server instances running on these servers in the same way.
I've set up a local port (3398) to redirect to the SQL Server port on the remote instance (L3398 -> remote.machine.com:1433).
I can then actually test the connection by telnetting to localhost 3398, and I get a connection: the screen clears and I can type characters to some listening process.
But when I try to connect SSMS to localhost:3398, it times out and then claims that there is no SQL Server listening on that port:
Cannot connect to localhost:3398
Additional information:
A network-related or instance-specific error occurred while establishing a connection
to SQL Server. The server was not found or was not accessible. Verify that the
instance name is correct and that SQL Server is configured to allow remote
connections. (...)
I am sure that the server accepts remote connections, because I have connected to it remotely while logged in via RDP to a different machine within the remote network.
I have Googled around to know that this is possible; does anyone have some idea why this isn't working, or what I might do to diagnose and hopefully fix the problem?
Thanks!
Instead of connecting to localhost:3398
Use 127.0.0.1,3398
For Authentication type Azure Active Directory - Universal with MFA (Mutli-Factor Authentication), in addition to specifying the port correctly (127.0.0.1,3398), I also had to point the host to localhost.
On Windows, I had to edit my hosts file to include the server host:
127.0.0.1 server.example.com
Then, in SSMS, I could connect to server.example.com,3398, which would perform the MFA correctly.
I could have performed this redirection at a higher DNS level as well.
The issue is probably that SSMS is trying to access the SQL Server Browser Service, which is UDP port 1434. Take a look at http://technet.microsoft.com/en-us/library/cc646023.aspx for an overview of the additional ports you may need to forward to get this to work.
I'm pretty sure I figured out the answer to this, actually.
On the remote network (which we don't control), for security purposes, it appears that the database servers are set up to ignore database requests coming from the gateway machine. So I guess there's just no good solution short of convincing them to give us full VPN access. Thanks everyone for your help.