Unable to connect to Aurora MYSQL - mysql

Hi I have created the Aurora database with MySQL Compatibility. Given public access as this is for the current dev/sample environment. Did not create any VPC, but it uses the default one, for which I have checked the subnets if it has route table to internet gateway and if it is allowing the security group and Network ACL to 0.0.0.0/0 and Mysql port. I dont have firewall blocking the port 3306. It is not serverless as well. I tried to ping and got request timeout from my laptop. Please help. Thanks.
Ping request gives me below error
Request timed out.
Connecting via mysql command gives me below error:
ERROR 1045 (28000): Access denied for user 'admin'#'x.x.x.x' (using password: YES)

Edit
It was confirmed to be a credentials issue, the OP reset their password which resolved the issue.
Original
The error you have is a credentials error, this proves connection between your host and Aurora is possible via the MySQL port.
The following should be checked to resolve the issue:
Check the username, if this was created with the Aurora Cluster check the console to ensure that it is spelt correctly.
Check the password you're entering is correct, if this is the user you created with the Aurora cluster then reset the password from the console.
Regarding ping, the AWS knowledge center says
Amazon RDS doesn't accept internet control message protocol (ICMP) traffic, including ping.
Below is more information about resolving connectivity issues from the knowledge center.

Related

Issue connecting AWS EC2 instance to GCP database

We are migrating our database from AWS to GCP. Our website is still hosted on an AWS EC2 instance for the moment.
We have allowed GCP to accept incoming connection from port 3306 with our EC2 instance's IP address.
I can ssh in to our EC2 instance and connect successfully to MySQL from the command line (port 3306), but if I try to connect programmatically on our EC2 instance we get a sql error: "Access denied for user 'my-user-name'#'162.8.X.X' (using password: YES)" (IP address is obviously replaced here).
Access denied means that your application was able to successfully connect to your machine. So you can eliminate any network issues.
Check if your user is allowed to make a connection from that IP.
Do this command to see the users:
SELECT user,host FROM mysql.user;
'my-user-name'#'162.8.X.X' should be in there with either the ip, or with 'my-user-name'#'%'.
If the entry is correct, the only thing remaining to check is to see if the actual password is correct.
Access denied for user is a error coming up from MySQL, so check the MySQL logs or password being passed as if there was a problem with your security group you might have got connection timed out error

Unable to connect to RDS MySQL database from MySQL Workbench

I have created a RDS MYSQL database and have set public access , modified VPC security groups enter link description here
but I am still not able to connect to the MYSql. Telnet also fails Could not open connection to the host, on port 3306: Connect failed
Connection from mysql workbench gives the following error Can't connect to MySQL server at .... (10061)
I've checked various posts in stack exchange on this error . But still unable to figure out what is missing.
Kindly let me know what is missing.
Some things to check:
The RDS instance should be configured as publicly accessible
The RDS instance should be launched in a public subnet
The Security Group should permit Inbound access for your IP address for port 3306
Your network must not be blocking the connection (try from another network, such as work/home or tethered via your phone)
I had the same problem and added a custom inbound rule in my security group with the port number from my database and the source set to my IP. this fixed it for me and telnet started working.

RDS Mysql ERROR 1045 (28000): Access denied for user #IP (using password: YES)

[This is not a duplicate question]
I have created a RDS MySQL instance with same Security Policy and under same VPC as my EC2 instance.
However when i am trying to access the Instance from EC2 machine i am getting error:
ERROR 1045 (28000): Access denied for user 'User'#'IP' (using password: YES)
Not sure if i am missing Anything.
In MYSQL setup we can resolve this error with added Privileges for User on the IP.Not sure how can we resolve this since i am unable to access the Instance itself.
Anyone faced this issue before?.
I have followed the Document: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.NonRDSRepl.html#MySQL.Procedural.Importing.Create.RDS.Database
mysql -h dandy-dbamazonaws.com[...] -u root -p
-h - put your endpoint
-u - username you set for your local mysql (root in my case). Don't confuse it with instance name
-p - after you hit 'enter' enter the password for your instance (the one you set up during instance creation)
hope it will work! that's how I resolved this issue
Maybe late but I had the same problem today.
Confirm the MasterUsername, with the AWS CLI running aws rds describe-db-instances or in the web console, showing the cluster details on the configuration tab.
Confirm the password, if you are using linux consoles (bash) some some characters may be problematic like # or !.
If you are using ssl connection you can't use --ssl-mode=DISABLED. You have to use --ssl-mode=VERIFY_CA (if you are connecting to endpoint) or --ssl-mode=VERIFY_IDENTITY (OR VERIFY_CA) if are connecting to server endpoint.
The goofy ones always get you: I experienced the same problem after changing the master password but let slip the important fact that by default changes don't take effect until the next maintenance window.
In my scenario I was connecting to an Aurora MYSQL serverless v2
Check you are connecting to the cluster writer instance endpoint
Modify the master password and apply changes immediately

Connecting to CloudSQL from App Engine

I have a Go app running on App Engine, and a first generation CloudSQL instance running. I can connect to the SQL server from dev using a TCP connection, specifying the SQL server's IP. But I cannot connect from the deployed instance, using the CloudSQL driver.
Sample code
import (
"database/sql"
_ "github.com/ziutek/mymysql/godrv"
_ "google.golang.org/appengine/cloudsql"
)
if (dev) {
sql.Open("mymysql", "tcp:1.2.3.4:3306*database/user/pass")
} else {
sql.Open("mymysql", "cloudsql:project-id:instance-name*database/user/pass")
}
(Yes, I'm substituting database, user, pass, project-id, and instance-name for their correct values in my real code)
When running locally (via goapp serve) I can connect and query the database - everything works great.
However, when connecting from the deployed instance, I get the following error:
Received #1045 error from MySQL server: "Access denied for user 'readonly'#'localhost' (using password: YES)"
I have made sure that my App Engine instance is authorized (SQL > Instance > Access Control > Authorization), and I'm using the same user in both cases.
I've found something resembling my error message on the Diagnosing Issues with Cloud SQL Instances page, but the suggested solution is to connect with SSL if SSL is enabled (I have not enabled SSL for the server).
If you get an error message like:
ERROR 1045 (28000): Access denied for user 'root'#'1.2.3.4' (using password: YES)
when you connect, verify that you are using the correct
password and that you are connecting over SSL if the instance requires
it.
Seeing as how this has given me so much trouble, I also tried connecting via IP address from the App Engine instance, but the socket connection is denied.

mysql fails to allow remote connection

I have followed the steps here:
ERROR 1130 (HY000): Host '' is not allowed to connect to this MySQL server
Carried out this activity dozens of times and it worked -- now for some reason it is not
I have done:
Comment out bind-address in my.cnf and restart service
GRANT ALL PRIVILEGES ON . TO 'root'#'%';
FLUSH PRIVILEGES;
The only difference here is that MySQL is running in a VM under VirtualBox and I am connecting to the VM mysql instance via WIndows 7.
SSH and other services work fine...
The passwords are fine as they work when I connect via SSH...
My new modem/router possibly at fault, blocking outgoing or ingoing connections on port 3306???
I assume that traffic from a host to guest still goes through the router...but the thing is...my requests are certainly making to the MySQL server as the log file shows fail requests...
WTF amm I missing???
The error I receive: Error No. 1045
Access denied for user 'root'#'my-desktop' (Using Passowrd: YES)
You also have to edit my.cnf. Change:
bind-address = 127.0.0.1
to
#bind-address = 127.0.0.1
then restart mysql. Also, if you are going to allow outside access, create a user other than root. That's always a bad idea.
By default connection from outside are not allowed for security reasons.
Because exposing your database to the public internet is never a good idea, you will need to whitelist the IP address manually to allow connection.