mysql error Access denied for user 'root'#'localhost' - mysql

I just installed MySQL on my pc using tutorial on the YouTube every thing set to default options during the installation the tutorial said that after the installation done I should open the MySQL 8.0 commend line client and then I should type the password to connect the database but when I open it and after I type my password it's close when I press enter so I tried to use the work MySQL workbench it's gives me this popup error I search on the internet for solution I got this here but this solution for ubuntu none of the answers are not applicable on windows but some other solution gives me some other errors :
C:\Users\husam>mysql -u root -p
Enter password: ***************
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
C:\Users\husam>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using password: NO)
I want to use the MySQL with ruby on rails project on windows 10

the issue wan in my password it's contain ' so I removed it and everything works fine

Related

Could anyone help me with a issue: Cannot Connect to Database Server(Mysql workbench, MAC OS)

I got this error when I tried to connect to local host, but it works fine last week. "Your connection attempt failed for user 'root' to the MySQL server at localhost:3306:
Access denied for user 'root'#'localhost' (using password: YES)"
I followed several ways in terminal: sudo mysql -u root -p
after i put my password, it says:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
no matter what i try, it always says access denied.
Would be appreciated if anyone could help!
As someone said in the comments, it seems you are using the wrong password. This link explains how to reset the root password if ever you need it https://phoenixnap.com/kb/how-to-reset-mysql-root-password-windows-linux

can't create user on mysql on windows

I just installed MySQL Version 8.0.27 on my windows machine, whenever i try to run MySQL command i get this error
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using password: NO)
and when i try to run MySQL -u root -p i get this error after specifying password
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
Also i can't locate my.ini file. i was thinking if i should add my.ini file manually or download another version of mysql
I fixed my issue by installing mysql version 5.6.11

mysql -v ERROR 1045 (28000): Access denied for user root'#'localhost' (using password: NO)

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

I am facing issues while starting mysql on macOS

Whenever I install mysql on macOS I get this error while starting it
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
I have tried the password which I got during the installation. The error then is :
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
I have also tried using root as a password or completely letting it blank but none of this worked
NOTE: I am using mysql using the MAMP setup and it is running just fine there.
It is located at:
/Applications/MAMP/Library/bin/mysql
I am able to run as root from there. Is it due to I am trying to run as root from two places? Please help me out.

MySQL on Mac: Access denied for user 'root'#'localhost' (using password: YES)

I installed MySQL on my Mac following the guide at https://dev.mysql.com/doc/refman/5.6/en/osx-installation-pkg.html
Then I downloaded MySQL and tried to connect to it, but I got the error:
I have tried to reset the root password as mentioned in Stuck with Access Denied for user 'root'#'localhost' - Terminal, Mac but it does not help.