Home > Net >  "Access denied for user 'Mysql@localhost' (using password: YES)" using MySQL she
"Access denied for user 'Mysql@localhost' (using password: YES)" using MySQL she

Time:01-06

I am new to sql and used MySQL workbench and shell, and I made a database in workbench and tried to access it in shell. This is what I did:

This was the shell console showed:

Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
MySQL  JS > \sql
Switching to SQL mode... Commands end with ;
MySQL  SQL > \connect root@localhost;
Creating a session to 'root@localhost;'
Please provide the password for 'root@localhost;': ****************
MySQL Error 2005: No such host is known 'localhost;'
MySQL  SQL > \connect root
Creating a session to 'HP@root'
Please provide the password for 'HP@root': ****************
MySQL Error 2005: No such host is known 'root'
MySQL  SQL > \connect Mysql@localhost
Creating a session to 'Mysql@localhost'
Please provide the password for 'Mysql@localhost': ****************
MySQL Error 1045: Access denied for user 'Mysql'@'localhost' (using password: YES)
MySQL  SQL > \connect Mysql@localhost;
Creating a session to 'Mysql@localhost;'
Please provide the password for 'Mysql@localhost;': ****************
MySQL Error 2005: No such host is known 'localhost;'
MySQL  SQL > \connect Mysql@localhost
Creating a session to 'Mysql@localhost'
Please provide the password for 'Mysql@localhost': ****************
MySQL Error 1045: Access denied for user 'Mysql'@'localhost' (using password: YES)
MySQL  SQL >

still learning here, and am available for more questions.

CodePudding user response:

In MySQL you need to set permissions for users to connect from specific locations, in this case connecting from localhost (note no semicolon).

Try logging in as root and then setting the MySQL user permissions to allow from localhost

  • Related