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?
Related
When I try to enter the root user from MySQL Workbench and manually enter it, I get the following error:
your connection attempt failed for user root to the mysql server
Access denied for user 'root'#'localhost' (using password: YES)
I am using mysql -u root code when I want to connect to MySQL via cmd and I get an error in it:
mysql: Unknown operating system character set 'cp857'.
mysql: switch to the default character set of 'utf8mb4'.
ERROR 1045 (28000): Access was denied for the user 'root'#'localhost' (using password: No)
I get a similar error when I try to log in using a password, the only thing that changes is (using password: YES).
What had I better do?
Issue with your password so simply change mysql root password.
here command
mysql -u root
then
mysqladmin -u root password [newpassword]
may help you this.
thanks
I want to configure a MySQL server for a wordpress.org project on Windows. However, I can't seem to connect to the MySQL server via MySQL shell.
when I inputted the command \connect root#localhost, and entered the password, I got an error:
MySQL Error 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
I assumed that I had forgot my password, and tried saving a txt file with the command
ALTER USER 'root'#'localhost' IDENTIFIED BY 'password';
Yet I got the same error message. I then reset the password with mysqld --skip -grant, and when I restarted MySQL and tried to use \connect, I got the error
MySQL Error 1045: Access denied for user 'root'#'localhost' (using password: NO)
I also tried mysql -u root -p, but got the error
ERROR: Not connected.
Basically everything that didn't start with \ generated a Not Connected error.
I tried using the Command Prompt instead of the MySQL shell, but got the exact same error.
How can I properly access 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.
I need help. When Checking mySQL version I get this error. I do not use mysql a lot and I am trying to set up a Magento store through command line. However, first I am trying to set up mySql from the database. I am using Mac OS Catalina and Zsh terminal.
Error.
mysql -v
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
I know it must be something with my database but I am confused. Any help would be appreciated. When I try to download Magento 2 setup install I get this similar error.
--db-user=root --admin-firstname=Magento --admin-lastname=User --admin-email=user#example.com --admin-user=admin --admin-password=123123q --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost' (using password: NO)
In InstallCommand.php line 264:
Parameter validation failed
EDIT: However, When I connect to mysql -u root I can connect to the database no problem.
You need to pass in the user and password when running mysql from the command line
mysql -u root -p
[enter password]
Alternatively, you can set up a mylogin.cnf (or a .my.cnf) to save the user/password as a file, so you don't need to remember it.
https://dba.stackexchange.com/questions/86595/how-can-i-make-mysql-client-read-password-from-mylogin-cnf
So I'm setting up mysql for the first time.
I read somewhere that I have to run this
mysql -u root -p
To log in as root, in order to be able to create tables/databases using the mysql command line.
When I run this, I get prompted for a password - I hit enter (I thought the default password was blank).
I get this error
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
What's going on?
If you have a fresh installation of MySql you should be able to issue the following command and it should allow your connection.
xyz#ubuntu$ mysql -u root mysql
You then should set the root password and then create a user with the correct level of access.
look HERE for help connecting.