When I tried to use navicat to connect mysql on AWS, it always reject the connection.
I'm sure my IP address is correct and the port is correct as I checked on EC2 for several times. Also the username and password are correct too because I can log in mysql on EC2.
I don't know what is wrong here. Any help would be really appreciated.
The first thing that will validate is that your instance of aws has active the port to which you want to connect in this case 3306 if it does not work with this you can connect by means of a SSH of the following way remembering that it has to have active the port 22:
Configure the ssh option
host: add the one that EC2 gives you e.g. ec2-127-0-0-1.compute-1.amazonaws.com.
Port: 22.
user: ubuntu or root (or the one indicated in your aws configuration).
Authentication Method: public key.
Private key: your .pem
In general:
Connection Name: whatever you want
Host: localhost or 127.0.0.1
Port: 3306
User: the database user
Pass: the database user.
Related
I have a Bastion host set up to be able to SSH into my RDS instance. I'm using Navicat 12 to make the connection to the database, and I'm reaching the SSH server on both Navicat as well as PuTTY, but I'm not able to actually reach the RDS instance and I'm getting the following error:
2013 - Lost connection to MySQL server at 'reading initial
communication packet', system error: 0 "Internal error/check (Not
system error)"
Here are the settings I'm using to connect:
SSH settings:
Host: my bastion public DNS
Port: 22
Username: ec2-user
Authentication Method: public key
Private key: my key path
Passphrase: none
Connection Settings:
Endpoint: my rds endpoint
Port: 3306
Username: my rds username
Password: my rds password
(I've also tried root with no password on this to test)
Security Group Info:
Bastion-
SSH/TCP/22/my local IP
RDS-
MYSQL/Aurora / TCP/3306/anywhere
If anyone can offer any sort of guidance or troubleshooting, I would super appreciate it!
AWS do not allow direct SSH access onto their RDS instances, I couldn't find where they state it in there documentation but there is this Forum where they say:
https://forums.aws.amazon.com/thread.jspa?threadID=93277
However - If you need to run scripts directly against the RDS you can install psql (or equivalent) on the bastion and connect to it through that.
I am new to programming, and do not have much idea about ports/forwarding/connection etc.
Installed Vagrant, MySQL Workbench, and Cygwin on Windows 8.1, then
Puphpet on Cygwin and created Virtual Machine, for learning.
But, unable to connect to MySQL on Virtual Machine (MySQL Server is on, on Virtual Machine) from Workbench in Windows.
I did not do any change in vagrantfile or config.yaml.
Tried Out:
Changed to bind-address = 0.0.0.0 in my.conf, but no use.
Commented out # bind-address = 127.0.0.1 in my.conf, again
no use.
Note: (I DELETED id_rsa file when it was not properly doing vagrant up
second time. So, gave full path to id_rsa.ppk, for connecting)
Connection Method: Standard (TCP/IP over SSH)
Parameters:
Hostname: 192.168.56.101:8957
SSH Username: vagrant
SSH Password: vagrant
SSH Key File: c:\cygwin64\home\tomy\puphpet\sutfva\puphpet\files\dot\ssh\id_rsa.ppk
MySQl Hostname: 127.0.0.1
Port: 3306
Username: dbuser
Password: 123
Error message:
IO Error [Errno 10061] No Connection could be made because the target
machine actively refused it. Please refer to logs for details
The answer at Vagrant MySQL Access is not clear to me. How to configure port forwarding?
Can you please guide me in simple words, how I can establish connection? Also, how to disconnect, and any security issue.
Thank you very much Juan Treminio and Brian Morton! Both of them gave valuable tips and inputs for me to come to track! In addition, immense thanks to Juan Treminio for his https://puphpet.com which is a huge help to persons like me.
COMPLETE Connection Details:
Choose
Standard TCP/IP over SSH
Parameters (Mostly default values since I did not change it)
SSH Hostname: 192.168.56.101
SSH Username: vagrant
SSH Password: vagrant
SSH Key File: C:\cygwin64\home\tomy\puphpet\sutfva\puphpet\files\dot\ssh\id_rsa
MySQL Hostname: 127.0.0.1
MySQl Server Port: 3306
Username: root
Password: 123
Note: Remember to note down your connection parameters
Hostname: 192.168.56.101:8957
You shouldn't need the port here, you should probably just need to ender 192.168.56.101
To verify which port SQL Server is listening on, you can ssh into the box and run
netstat -lnutp
This will output a list of the currently open and listening ports on the box. If you do not see SQL Server in the list, then it is not currently running and the service will need to be started.
I am new to AWS RDS and I am trying to connect MySQL workbench to the instance on AWS. I want to have full admin access in the Database.
Connection Method: Standard TCP/IP over SSH
SSH Hostname: (AWS given endpoint)
SSH UserName: (not sure which user name they are asking for...ec2 or root?)
SHH Password:
SSH Keyfile: assuming this is the .pem file from AWS
MySQL HostName: 127.0.0.1
MySQL ServerPort: 3306
username: mysql username
password: mysql username password
Very new to this so any help would be greatly appreciated!
Thanks,
OK_Sooner
Be sure that security group of your instance accept connections from your ip. And as John Rotenstein said - you don't need to connect by ssh. Just connect to port 3306.
I am getting the error listed above when trying to connect to my MySQL server via SSH public key in Navicat. I have searched endlessly trying to find a solution to this. I have made sure that the AllowTCP option is enabled, and I have tried setting the hostname to localhost and 127.0.0.1 but neither of them work, it only changes the error to Connection Refused.
Here are my connection properties:
(General Tab)
Hostname/IP Address: mydomain.com
Port: 3306
Username: myusername
Password: mypassword
(SSH Tab)
Hostname/IP Address: mydomain.com (have also tried localhost/127.0.0.1)
Port: 3850 (this is the correct port)
Username: myusername
Authentication Method: Public Key
Private Key: C:\Path\To\My\Key
Passphrase: mySSHpassword
I know that probably isn't much help because there's not really any "settings" other than the ports, which I know are correct.
I am running these exact same credentials on my Macbook which runs SequelPro and it works flawlessly, so I'm lost as to why I can't get it working on my PC through Navicat.
Thanks for any help you can provide.
The General tab would be set to localhost (or 127.0.0.1) and the username and password would be the database credentials, not the host credentials.
Then the SSH tab would be your host with the username password you use to ssh to the host. It should be the normal ssh port 22.
I was able to get my Navicat connected using SSH to my Rackspace MySql database from my OS X (MacBook).
The key was the settings in the General Tab. I had to set the HostName/IP to the remote name of the MySql Server.
[identifier-from-the-mysql-hostname-instance].rackspaceclouddb.com then the username and password as defined for my MySql database.
The SSH described in the prior responses, matched my settings.
New to connecting to databases and have no clue to where to begin to troubleshoot -
I am currently using HeidiSQL to connect to an external Mysql Database Server hosted on the Amazon Web Service - EC2.
I am able to access the database using HeidiSQL with the settings:
MySQL (SSH tunnel)
Hostname/ip: 127.0.0.1
user: (user)
password: (pw)
port 3306
in SSH tunnel tab:
plink.exe location is set to putty.exe
sshhost + port: (my host ip) port 22
private key file: (is set)
local port: 3307
Using this configuration I AM able to log into my database.
My problem is when I am trying to do it using my own putty commands using the port forwarding:
In Putty:
I set SSH>tunnels - source port: 3307, destination (my host ip):3306
Local and Auto.
I connect using my passwords and hostip
Back to HeidiSQL, I put my settings to:
MYSL (TCP/IP)
hostname: localhost
user: (user)
password(pw)
port 3307
and try to connect. I get the following error:
SL ERROR (2013): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
From what I have read, this means my ssh tunnel is working but something else is wrong. I am now at a loss on why this doesn't work. Am i not setting something else up properly? Firewalling myself? My ultimate goal is to hook up another application to communicate with the database using ODBC orJDBC using the same port forwarding idea. Are there logs to check somewhere?
You must set
AllowTcpForwarding yes
PermitTunnel yes
in /etc/ssh/sshd_config
It seem's like your're trying to do this:
http://realprogrammers.com/how_to/set_up_an_ssh_tunnel_with_putty.html
It should work. I assume the ssh server and mysql server are running on the remote machine.
In Putty: I set SSH>tunnels - source port: 3307, destination (my host ip):3306 Local and Auto. I connect using my passwords and hostip
It should be: set SSH>tunnels - source port: 3307, destination 127.0.0.1:3306 Local and Auto.
heidisql: MYSL (TCP/IP) hostname: localhost user: (user) password(pw) port 3307
Notice that if you have a MySQL service running on your local machine, on the port your trying to listen (3307 ) you'll get a 2013 error, even if the local service is down! In that case, use any arbitrary unused port.
Also, if the remote mysql server has the user table (mysql database) restricted to certain hosts this won't work. Unless you find out how the server recognize himself (computer name) and add him on the user table or simply you use the '%' wildcard.
Follow below steps it solved my issue while connecting to Live server:
Find your IP (Google - what is my ip).
Go to C-Panel of your Live Server.
Go to Remote MySQL in C-Panel.
Add IP address that you got from Step 1 and save it.
Now try to connect through Heidi SQL.
Please let me know if it helped.