I just created a user account for myself to access only the MariaDB database I just created ("publications") using XAMPP on a Windows 10 PC.
I did this by using the code at the end of this post.
I then try to sign into the database by using this path and command in the command prompt:
C:\xampp\mysql\bin\mysql -u steve -p
It then prompts me for a password, but when I enter the password I get the error
"ERROR 1045 (28000): Access denied for user 'steve'#'localhost' (using password: YES)"
I know the password is correct because I created it.
Note that this is NOT a root-level password; it should only work for the "publications" database.
Strangely, I can just bypass the password requirement by hitting "enter," but I want access to this database to be password-protected, but when I DO enter the password, I get the error!
Why am I getting this error? Do I need to reset my password? If so, how?
Thanks!
Code I entered:
GRANT ALL ON publications.* TO 'steve#localhost'
IDENTIFIED BY 'password';
After you entered command:
mysql>GRANT ALL ON publications.* TO 'steve'#'localhost';
Then flush:
mysql> FLUSH PRIVILEGES;
Try login again.
Note: make sure you created an user as follow command:
CREATE USER 'steve'#'localhost' IDENTIFIED BY 'passpass';
and note:
'steve#localhost'
or
'steve'#'localhost'
on GRANT ALL command
Related
I'm using Mamp to enter phpMyAdmin, and I created a user. I tried to access MySQL through the command line using: mysql -u testing -p, then entering the password. I get Access denied for user 'testing'#'localhost' (using password: YES). I also can't access through root. Any help would be appreciated.
You must login with root user and change resting user previlege. your can see this post
MySQL: Access denied for user 'test'#'localhost' (using password: YES) except root user
Using the same credentials, and the root user having a localhost setting. I can login using the same credentials through a phpmyadmin interface. But not through the command line. I've setup the mysql, changed the password and all else. I should be good to go, however I I keep getting
ERROR 1045 (28000): Access denied for user 'root'#'localhost'
In the command line, this seems to also be the case with other as well. So I am not sure what the issue is.
Try using sudo mysql -u root command to access the mysql-server.
If that does not work create a new user through phpmyadmin :
CREATE USER 'username'#'localhost' IDENTIFIED BY 'password';
Then give it all the privileges :
GRANT ALL PRIVILEGES ON db_name. * TO 'username'#'localhost';
(if you want to give the user access to all the databases, replace db_name with an asterisk (*) )
then flush privileges to reload permissions :
FLUSH PRIVILEGES;
Then try to connect using that user through the command line
sudo mysql -u 'username' -p
You will be asked to type in the password.
I have a Linux EC2 instance which has MySQL server installed on it.
I can login with MySQL root with this command:
mysql -u root -p
For some reasons I created a user guest using following commands:
CREATE USER 'guest'#'%' IDENTIFIED BY 'passpass';
GRANT ALL PRIVILEGES ON * . * TO 'guest'#'%';
FLUSH PRIVILEGES;
Then I exit from root user and try to login with guest user:
mysql -u guest -p
entered the correct password and got this error:
ERROR 1045 (28000): Access denied for user 'guest'#'localhost' (using password: YES)
I even checked out for the anonymous user .
mysql> SELECT User, Host, Password FROM mysql.user WHERE User='';
Empty set (0.00 sec)
Kindly help. I am not able to connect to MySQL using guest user credentials
MYSQL AWS LINUX EC2 INSTANCE
I was trying to access mysql in AWS linux EC2 instance, but was getting the error:- Error: Access denied for user 'root'#'localhost'. After lot of searching I got the solution which worked for me.
So for mysql community server, the default password is randomly generated whenn you install.
Check /var/log/mysqld.log file, write vim /var/log/mysqld.log in terminal and search for the keyword "temporary password"- you will get the password.
Few configurations are required for mysql- sudo /usr/bin/mysql_secure_installation
it will ask for password then enter the "temporary password" collected earlier. and in the proceding steps question will be asked over there new password could be easily set. then can proceed with
mysql -u root -p.
try by Run the command
grant all on . to 'guest'#'%' identified by 'passpass';
flush privileges;
Thanks
I have been used following command but it was not working.
GRANT ALL PRIVILEGES ON *.* TO ROOT#LOCALHOST IDENTIFIED BY "my_password";
You are not connected (in the way of a login & username) to the database, you need to connect. depending on the way you acces the database.
in command line, you can use this:
mysql -pYourpassword -u username
Please forgive me for being a complete beginner:
I am trying to log into my very first mySQL database that I installed using easyPHP on my windows machine, using the cmd line. I am going to the \mysql\bin and entering the command:
mysql -u root
in order to log in, but I am getting the following message:
error 1045 (28000) access denied for user 'root'#'localhost' (using password: YES)
Why is it using the password "YES"? Shouldn't there be no password at all? Do I need to restart mySQL or something? If so, how do I do that? If it's relevant, I did try to create the database using phpmyadmin, but had a few problems entering columns and decided I'd be better off working from the command line so I could learn all the commands as I went along.
Please keep in mind that this is my first time ever trying to work with a database, so be kind to me!
To have mysql asking you for a password, you also need to specify the -p-option:
mysql -u root -p
When logging into MYSQL using the command line, you also have to specify the password if any. Your error message is telling you that the user "root" has a password attached to it. Not necessarily that the password is "YES" when you were installing easyPHP, it should have either provided you with a default password or allowed you to enter a password of your choosing.
According to the documentation of easyPHP:
[v1.6] My scripts worked perfectly with 1.5 but now I get this error : Warning: Forbidden access for user: 'user#localhost' (password: YES) when I want to connect to MySql.
Only the root user (without password) has the rights to connect to the database. Either modify your scripts to use it, or add the user you need (phpMyAdmin/users and privileges: See phpMyAdmin's documentation for more information).
mysql -u root -p
Now if you changed your root user password, you will need to specify that when prompted. Otherwise simply hit <Enter> on your keyboard.
If you FORGOT the password to root, and have changed it, you will have to subsequently reinstall easyPHP.
agk-hp:~/$mysql
ERROR 1045 (28000): Access denied for user 'greg'#'localhost' (using password: NO)
agk-hp:~/$sudo cat /etc/mysql/debian.cnf|grep password
password = t7753my3D2x4yfQm
agk-hp:~/$mysql -u debian-sys-maint -p
Enter password: {t7753my3D2x4yfQm}
Welcome to the MySQL monitor. Commands end with ; or \g.
mysql> use mysql;
mysql> grant all privileges on *.* to 'root'#'localhost';
mysql> grant all privileges on *.* to 'greg'#'localhost';
agk-hp:~/$mysql
mysql>
A modification for mysql- 5.7.10 on mac mac el capitan
sudo /usr/local/mysql/support-files/mysql.server stop
sudo mysqld_safe --skip-grant-tables
Now open new window/tab on terminal and type
"mysql -u root"
use mysql
update user set authentication_string=password('yourpassword') where user='root';