MySQL Unable to connect to remote host - database

I am just wasting too much time with this issue. My final goal is to change the collation of the Amazon RDS DB from latin to utf8. To accomplish that, there is a lot of information out there, and yet, non of that has worked for me.
First of all I tried to prompt mysql:
mysql -h ###.###.us-west-1.rds.amazonaws.com -p --port=3306
but it raise an ERROR 2003 (HY000): Can't connect to MySQL server on '###.###.us-west-1.rds.amazonaws.com' (60)
If I try using telnet:
telnet ###.###.us-west-1.rds.amazonaws.com 3306
Trying 54.###.##.##...
telnet: connect to address 54.###.##.##: Operation timed out
telnet: Unable to connect to remote host
Looking at the aws.docs says that I have to authorize access to my cache cluster. But I could't get that far. I didn't know what to put on the Port rangeand Source by trying to add a new Custom TCP rule for my default security group. So I ended following this tutorial using mysqldump but I have the same connection problem as using >mysql
Any help would be really appreciated!

Related

Unable to connect to postgres server remotely(ubuntu 16.04)

I am pretty new to postgreSQL. I am running version 9.5 of it on my main machine. I am trying to establish a telnet connection from my virtual machine. Before doing that I have configured the postgresql.conf and pg_hba.conf files to accept connection from remote machine in the same network.
However when I start the postgresql service using:
service postgresql start
The process show the status:
active(exited)
and the telnet connection is also refused(when i run telnet x.x.x.x 5432). Also when i start the postgresql service using
systemctl start postgresql#9.5-main
the status is active(running) but the telnet connection is still refused. Can anyone tell me how to establish the telnet connection? I dont really know whats going on and I am new here so please dont mind if its a noob question

Connection to Postgresql database failing

I'm trying to connect to my localhost Postgresql database and I'm getting an error:
Connection to database... failed
No other message provided.
I'm using using pgAdmin3 connecting to Postgresql 10.1
I've been connecting to this database using the same user (and password) and another user via my app successfully all the while but it just failed to connect to the database now. No users seems to be able to connect to the database
Edit: after further checks I noticed Postgresql is not listening on the port 5432.
I've checked the postgresql.conf file and it looks fine
listen_addresses = '*', port = 5432
I'm kind of new to Postgresql. Sorry if it's something obvious I'm missing out. Still looking for how to start postgresql or make it listen on the port.

Connecting to MS SQL Server from MAC application with FreeTDS fails

I'm trying to connect to Microsoft SQL Server from my Mac application using iODBC and FreeTDS. No matter what I do, I get the error message Unable to connect to data source from the FreeTDS driver. i have consulted as many possible manuals, blog posts, and StackOverflow questions.
Following is the troubleshooting steps i tried and more details about my code,
DB Connection string = Driver=/Applications/xxx.app/Contents/Frameworks/libtdsodbc.so;Server=ip;DATABASE=DB;TDS_Version=8.0;Port=1433;ClientCharset=UTF-8;uid=username;pwd=*****;Trusted_Connection=No;
From application logs,
SQLGetDiagRec function returns
[01000] [FreeTDS][SQL Server]Adaptive Server connection failed (20002)
[08001] [FreeTDS][SQL Server]Unable to connect to data source (0)
Few StackOverflow post's suggested this is due to TDS version and changing to 8.0 would help but its already set.
When I ping the server - no packets are lost.
Connection is established when i telnet the server on 1433 port.
Using the below i am able to establish connection too,
tsql -H >IP< -p 1433 -U username -P password
In this particular post as per the comments by Max Bolingbroke
if SERVER attribute is used then freetds.config and odbc.ini are ignored. So i guess the config file parameters dont help much.
Could anyone please provide me with some pointers or any help so i can proceed further.

Connection refused to PostgreSQL server

I am currently setting up a postreSQL server on my Windows computer.
I want to create my first database, but couldn't create the createdb function due to a password authetification failed. Thus I found the following question on this website:
How to configure postgresql for the first time?
However, I think I forgot the ; at the end of :
ALTER USER postgres with encrypted password 'xxxxxxx';
And now, when I try to launch psql, I have the following errors:
Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
Active code page: 1252
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Press any key to continue . . .
Any idea of what I could do to solve the problem?
Do you think it is really the missing semi column that caused the problem?
Do you have any tutorial on how to setup a postgreSQL database on Windows? All the one I found until now were for Linux only.
The error you're getting appears to be from Postgres not currently running, rather than an authentication error as you're presumed. The PSQL client or whatever PG client you're using is attempting to establish a connection on the default port but nothing is there.
If Postgres isn't currently running, try finding it (Via CTRL-Alt-Delete). If it's running, try terminating it and starting it up again. Hopefully that fixes the problem... Otherwise your port 5432 might be blocked for some reason.
If all fails, I am still skeptical the parentheses could cause this error because it's not an authentication error. Try to reinstall Postgres with a clean install.

Connecting to SQL server, getting error 2013 (HY000) Lost connection

I am on Linux, trying to connect to SQL server.
Using sqlplus, as below:
sqlplus username/password#server:port;
Getting ORA-12537 error - "TNS: Connection closed". This error comes after a long wait.
While trying to figure out what the issue was, I got -
"TNSPING server:port" returned error : TNS-12537 TNS Connection closed.
"TELNET server port" is working fine. It shows connected status.
Also tried using Easy connect after reading another post LINK. This is the command I tried "sqlplus username/password#//server/port". It gave me error ORA-12541 : TNS: No listener.
Just want to add that I am able to connect to an Oracle db using sqlplus, with no problem.
Version is 10.2.0.4.
Any idea how to fix this? Appreciate the help!
UPDATE: I did not know sqlplus can't connect to SQL server. I tried connecting using mysql, but got an error:
MYSQL -h server -P port -u username -ppassword
returned error : ERROR 2013 (HY000): Lost connection to mysql server at 'reading initial communication packet', system error 104. This error also comes after a long wait.
Thanks for your help!
You will need an SQL Server specific client to connect to SQL Server, sqlplus is a oracle client and mysql is a command line client for the mysql server. Microsoft provides a JDBC driver at http://msdn2.microsoft.com/en-us/data/aa937724.aspx or a Linux ODBC driver at http://www.microsoft.com/download/en/details.aspx?id=28160. This might help if you have some kind of software that can use those drivers, e.g. RazorSQL (http://razorsql.com/features/sqlserver_features.html)

Resources