What is going on with the below? Why will mysql not let me in? I am using 5.6
root#ip-10-93-145-98:/home/ubuntu# echo "grant all privileges on *.* to 'really'#'%' identified by 'stupid';" | mysql -u root -ptest101
Warning: Using a password on the command line interface can be insecure.
root#ip-10-93-145-98:/home/ubuntu# mysql -u really -pstupid
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'really'#'localhost' (using password: YES)
Run a FLUSH PRIVILEGES after the GRANT ...
Try to login again after that.
Related
I am trying to connect MySQL Client to docker. I can connect just fine on the MySQL 8.0 Command Line Client, but when I try to connect to it from docker I get this error:
C:\Users\Bolin>docker exec -it mysql mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
I am on a window machine and I am trying to follow this tutorial
https://phoenixnap.com/kb/mysql-docker-container
hmm, looks like the issue is with privilege user for the database table,
Try to create a privileged user in your database named root. After that please check again
==========================================================================================
try these queries in your databse:
INSERT INTO mysql.user (Host, User, Password) VALUES ('%', 'root', password('YOURPASSWORD'));
GRANT ALL ON *.* TO 'root'#'%' WITH GRANT OPTION;
if the above code doesn't work try with the second
$mysql -u root mysql
$mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root';
$mysql> FLUSH PRIVILEGES;
I have two nodes: node1 and node2. I want to access MySQL installed on node1 from node2.
I have so far tried using grant all privileges on *.* to 'mysql'#'node2.openstacklocal' with grant option; on MySQL but I still get the below error:
===ERROR===
[mysql#node2 ~]$ mysql -p -h mgmt.openstacklocal -u mysql -P 3306
Enter password:
ERROR 1045 (28000): Access denied for user 'mysql'#'node2.openstacklocal' (using password: YES)
I guess I got the solution
Login to mysql
Run command
grant all on mysql.* to '<remoteuser>'#'node2.openstacklocal' identified by 'password';
Note - Notice this command is missing word 'privileges'
Hi I have followed the instructions mentioned on Mysql reset root users to default. (answer by Nthalk) But I get a new error. My intent is that root should get all permissions.
Any ways to get over this issue ?
mysql> grant all privileges on *.* to 'root'#'localhost' identified by "" with grant option;
ERROR 1045 (28000): Access denied for user ''#'localhost' (using password: NO)
You can't do this without being logged in as root to start with:
mysql -u root
The best way to change the password is:
mysqladmin -u root password 'new password'
Using a mac w/ mountain lion, I just installed mysql. I am now trying to login using the following command
mysql -u mike -p
but get the following error:
ERROR 1045 (28000): Access denied for user 'mike'#'localhost' (using password: YES)
I have referenced the following SO question & answer: MySQL ERROR 1045 (28000): Access denied for user 'bill'#'localhost' (using password: YES)
based on all those answers I need to create a new local user inside mysql command line, but how do I do this if I can't get access to the mysql> (command line)?
By default, the root user has no password in MySQL (unless you set a root password in mysql during the install). Try logging in like this:
mysql -u root
Note the exclusion of the -p argument.
Try using:
$ mysql -u root -e "CREATE USER 'mike'#'localhost' IDENTIFIED BY PASSWORD 'secret';";
And then see Grant Syntax for setting the appropriate priviledges.
I create a new mysql user by using
CREATE USER 'new-username'#'localhost' IDENTIFIED BY 'new-password';
GRANT ALL ON *.* TO 'new-username'#'localhost' WITH GRANT OPTION;
And I can access mysql by
mysql -u new-username
But I got this error message when I try to access mysql using password
mysql -u new-username -p
error message
ERROR 1045 (28000): Access denied for user 'new-username'#'localhost' (using password: YES)
Something I am missing? Mysql version is Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)
Thanks
Here you required to pass password but you dont have entered any password.
CREATE USER 'new-username'#'localhost' IDENTIFIED BY 'new-password';
GRANT ALL ON *.* TO 'new-username'#'localhost' WITH GRANT OPTION;
mysql -u new-username -p new-password
And if you want to remove password from that then just use following line
SET PASSWORD FOR 'new-username'#'localhost' = ''