Why is MySQL sometimes failing to connect to AWS RDS Aurora - mysql

I'm getting a bizarre behavior on an EC2 instance connecting to an AWS RDS cluster that I can't explain. With the exact same connection string, it works about 20% of the time. I at first thought it had to do with a Drupal installation issue, but I stepped back and tried directly connecting from the command line, and I'm getting the same thing. Here are some examples of the outcome:
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
ERROR 1045 (28000): Access denied for user 'admin'#'10.1.18.15'
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
ERROR 1045 (28000): Access denied for user 'admin'#'10.1.19.253'
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
ERROR 1045 (28000): Access denied for user 'admin'#'10.1.18.15'
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
ERROR 1045 (28000): Access denied for user 'admin'#'10.1.18.15'
[root#xxx]# ^C
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
SUCCESS.
This also is similar to what I was seeing from Drupal: about a quarter of the time the pages loaded.
Those IP addresses are - I think private IP addresses that I've never seen in our network, so I don't know where they are coming from.
Any suggestions?

This isn't entirely an answer, but I've found two things that work. One might be a red herring.
If I use a connection string that contains the password in it - i.e. -pThePasswordHere - it would complain about a special character in the password, specifically a close parenthesis. When I connect normally, it would tell me Access Denied, but not complain about the parenthesis. Changing the password to not contain special characters made it work.
Creating a new user also made it work.
I didn't test making a new user with the old password with a close parenthesis though so can't say 100% which is the answer.

Related

How can I restart mysql without getting this error?

sudo service mysql restart
But I get
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
I then enter and can enter mysql without any problem.
mysql -u root -h localhost -ppassword databasename
My question is that, can I restart mysql service without getting that error by maybe supplying hostname and password straight away.
somtimes error occurs but changing mysql password can solve the error.
and once you changed your password, you're error free.

MySQL Error 1044/1045 Access denied for user

When I'm trying
mysql -u mlimon -p
Then input the password it successfully login to the MySQL but when I'm trying something like this
mysql -umlimon -pmySqlPassword
Or
mysql -u mlimon -p mySqlPassword
OR
mysql -umlimon -p <<MY_QUERY
USE mysql
SHOW tables
MY_QUERY
It's returning
ERROR 1045 (28000): Access denied for user 'mlimon'#'localhost' (using password: YES)" Or something Error 1044 Access denied
My main intention to run some query in shell script but if I can't login directly to the database it's won't run and when I'm trying to pass the password it's showing access denied. but my question is why it's working when I'm imputing the password in command separately and not working with other way?
NOTE: my password contain a dollar sign, so is this something make the difference here?

1045 error when running mysqldump

When i am running mysqldump with user(lets say test) i am getting error message:
mysqldump: Got error: 1045: Access denied for user 'test'#'localhost' (using password: YES) when trying to connect
Although the database and user details are correct as i am able to login. Also when i use mysqldump without passing -p then it works fine and ask for user password.
mysqldump -u test -p dbtest > dbtest.sql
Enter password:
I tried to pass --port, -h 127.0.0.1 as mentioned in other threads but nothing works.

Cannot run MySQL - ERROR 1045 (28000)

I am on Ubuntu. I did not set any password to my root account during the MySQL installation process. I am trying to run MySQL with
mysql -u root
However, I can't, ending up with the following access denied error.
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
Then, I thought it might be due to the password issue. I tried this and enter an empty password and hit the Enter key.
abc#ubuntu:~$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
Then, I even tried entering a password (my user password on the computer). I ended up with this
abc#ubuntu:~$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
I have seen some solutions, but most of them require to run MySQL first in order to resolve the issue. However, I find myself not able to do anything, stuck here.
You must login from root so for this you must write sudo like:
sudo mysql -p
First give your system password
then it asking for mysql server password, in my case '123'
Then you acces your database.
Your command looks ok. It looks like you need to reset the root password
Resetting MySQL root password

Importing a database into MAMP via Terminal, can't connect

After frivolously attempting to import a large database (84mb) into PHPMyAdmin (tried increasing memory limit, timeout limit), I've tried importing the database via Terminal/command line, only to be denied access to the MySQL database.
I tried the method here: http://nickhardeman.com/308/export-import-large-database-using-mamp-with-terminal/
I tried the root user/password, I tried creating a new user with full db access, still no luck. Getting these errors:
YI:trunk mpfefferle$ /applications/MAMP/library/bin/mysql -u [root] -p [mydbase]
Enter password:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
bash-3.2# /applications/MAMP/library/bin/mysql -u [admin] -p [mydbase]
Enter password:
ERROR 1045 (28000): Access denied for user '[admin]'#'localhost' (using password: YES)
I'm absolutely at my wit's end. All I wanted to do was check out a working copy of the site from the SVN repos, but I need the mysql db in order to run/edit/test the site so I can update Magento so I can add new features so I can sell some lousy new products. I'm ready to give up on web development entirely. I hate it and I wish the internet would go away forever.
ID-10T Error: I didn't remove the brackets from the command I was trying to execute. /applications/MAMP/library/bin/mysql -u root -p mydbase instead of /applications/MAMP/library/bin/mysql -u [root] -p [mydbase]