java.sql.SQLException Access denied for user 'root'@'localhost' using password NO using password YES

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome back to our channel so in today's video we will see the error that is related to when we are trying to connect our spring application with the mysql database or any rdbms then we are getting some error that is x is denied for user ro vector 8 local host and the bracket it is written using password yes so guys this error comes due to two reasons and those are so first what you have to do is you have to navigate to your project like my project is user login in which i am trying to connect my string application with the mysql database and in that you have to go to the source main resources and there you can find the application dot properties file now in this file guys there are five statements written over here the first one is the url that uh with which i am trying to connect with the local host at port 3306 with mysql database second one is the username and third one is the password fourth and fifth guys you will see later on so java tv is basically the name of the database from which i'm trying to connect now guys this error come when we give either username wrong or the password wrong like here you can see that my username is simply r o but if i go to the mysql command line and enter into this select current okay this is the command from which you can check who is the current user on your my sql database so as soon as i press enter i can see that the current user is root at the rate local host so guys this was one of the reason that i was getting the error so i have to simply correct it and we'll save this and we'll try to run it again and let's see if that works or not so here you can see that my spring application has started to boot up and now guys here you can see that i have got the success message that is tomcats started on port 8080 started user login application in uh or time means i've not got any kind of error so guys the first reason i have shown you that username is could be wrong now the guy's second reason could be let me terminate this process what if i just make the password wrong as my password is currently root but what i'm doing trying to do is i'm just somehow given my password wrong now let's try to run this application again now guys you can see that again i've got a whole bunch of error that is different types of frames are omitted but as soon uh you will scroll up and will reach to the top of this error so here you can again see the same thing that is x is denied for now the username is correct and the same error is there but this error is because of the password so guys two reasons we have find out that either username could be wrong or password could be wrong now guys if you don't give the password at all and try to run this application then the error that you would get is that using password and here it would be written no so let's see that also now guys the same error that we have got we will scroll it up again and we can see that as i have saved the excess denied and using password mode so guys these were the three uh two errors basically and three reasons why you got this error so if you got the same error then check the following file with the following uh strings and guys if you have any error then you can ask in the comment section contact us on instagram or on twitter thank you
Info
Channel: crazzylearners
Views: 34,189
Rating: undefined out of 5
Keywords:
Id: XZtrd7dtYN8
Channel Id: undefined
Length: 3min 54sec (234 seconds)
Published: Wed Jun 15 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.