psql -h [hostname] -U [user] [database]
psql: FATAL: no pg_hba.conf entry for host "..*.", user "[user]", database "[database]", SSL off
psql -h ... -U [user] [database]
psql: could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "..." and accepting
TCP/IP connections on port 5432?
Related
I have a Redis server machine and I can connect it successfully on my mac or a linux machine A with:
redis-cli -h xxxx -p xxx -a xxxxx
However, when I try to connect it with another Linux client machine B, it fails with
Could not connect to Redis at xxxx:xxx: Connection timed out
How can I diagnose with the client machine? It seems the problem is with linux machine B. But how can I diagnose with it?
I am new to JMeter and trying to send HTTP request and an email using JMeter and SMTP.
I am getting JMeter error as Non HTTP response code:
java.net.SocketException/Non HTTP response message: Connection reset
and SMTP error as 500/
Could not connect to SMTP host: smtp.1and1.com, port: 587
I have done the following settings:
user.properties:
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
hc.parameters :
http.connection.stalecheck$Boolean=true
These changes still didn't solve my problem. Can you please help that where should I have to change the setting to fix this.
Check your connection settings, if you are testing from a proxy, you need to specify your proxy server host and port to JMeter.
Run the jmeter[.bat] file from a command line with the following parameters:
-H [proxy server hostname or ip address]
-P [proxy server port]
-N [nonproxy hosts] (e.g. *.apache.org|localhost)
-u [username for proxy authentication - if required]
-a [password for proxy authentication - if required]
Example:
jmeter -H my.proxy.server -P 8000 -u username -a password -N localhost
Check this for more information:
JMeter proxy server
I'm trying to import data from an SQL Server to my HIVE and I get the following error:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection
to the host ip address databaseName=SherLock2, port 1433 has
failed. Error: "null. Verify the connection properties, check that an
instance of SQL Server is running on the host and accepting TCP/IP
connections at the port, and that no firewall is blocking TCP
connections to the port.".
This is the command I'm trying to run:
sqoop import --table Sms --target-dir SherlockData/Sms --username yogevmet --password password --connect "jdbc:sqlserver://ipadress databaseName=SherLock2" --split-by UUID --hive-import -hive-table SherLock_2.sms --driver com.microsoft.sqlserver.jdbc.SQLServerDriver;
I looked up here: JDBC connection failed, error: TCP/IP connection to host failed
And everything is set as it suppose to be, does someone have any other suggestion?
Thanks
I'm using RStudio on OSX and have a local vm running Ubuntu. I'm having issues with RMySQL connecting to mysql running on the local vm via ssh. I've tried forwarding port 3307 via
ssh -L 3307:d.local.internal.com:3306 ubuntu#d.local.internal.com
followed by the following in r
con <- dbConnect(RMySQL::MySQL(), host = "127.0.0.1", user = "root", password = "pass", port=3307)
I'm still getting
Error in .local(drv, ...) : Failed to connect to database: Error: Can't connect to MySQL server on '127.0.0.1' (57)
Any ideas? I am able to successfully connect via SequelPro with the same ssh and mysql credentials.
Try
ssh -L 3307:localhost:3306 ubuntu#d.local.internal.com
I bet d.local.internal.com can't resolve d.local.internal.com hostname, because you may not have DNS entry for d.local.internal.com in the DNS server used by d.local.internal.com or for that matter a /etc/hosts entry.
Also you don't need to setup your local port to 3307, you can use 3306, provided you don't have anything listening on 3306 on your host.
I am trying to use dplyr to connect to a remote database, that I usually query through a ssh tunnel.
I first set up a ssh tunnel like the following:
alias tunnel_ncg='ssh -fNg -L 3307:127.0.0.1:3306 mysqluser#myhost mysql5 -h 127.0.0.1:3306 -P 3307 -u mysqluser -p mypassword'
At this point I can access the database by connecting to localhost:3307. For example:
mysql -h '127.0.0.1' -P 3307 -u mysqluser
If I try to access the same database through dplyr, I get an error complaining that it can't connect to the local MySQL socket:
> conDplyr = src_mysql(dbname = "mydb", user = "mysqluser", password = "mypassword", host = "localhost", port=3307)
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
My understanding is that RMySQL/dplyr are trying to looking for a socket file in the local computer, however they should really be looking for it in the remote server. Is there a way to fix this, or a work-around?
UPDATE:
If I try to connect through dbConnect/RMySQL, the connection works fine:
> dbConnect(dbDriver("MySQL"), user="mysqluser", password="mypassword", dbname="mydb", host="127.0.0.1", port=3307)
<MySQLConnection:0,1>
As silly as it sounds replacing localhost with an IP address (127.0.0.1) solves the problem.
src_mysql(
dbname = "mydb", user = "mysqluser", password = "mypassword",
host = "127.0.0.1", port=3307)
For an explanation take a look at the MySQL documentation:
On Unix, MySQL programs treat the host name localhost specially, in a way that is likely different from what you expect compared to other network-based programs.
For connections to localhost, MySQL programs attempt to connect to the local server by using a Unix socket file. This occurs even if a --port or -P option is given to specify a port number.
To ensure that the client makes a TCP/IP connection to the local server, use --host or -h to specify a host name value of 127.0.0.1, or the IP address or name of the local server.