1.11M Members

How to login in MySQL with newly created username and password?

 
0
 

Hi, I installed MySQL from the MySQL site. The setup procedure required me to set an username and password, which I set as X and Y respectively (say). Then when I opened the mySQL command line client, it asked for password, and after providing Y, I was allowed in. Once in I created a new user with a password with this command:

CREATE USER 'CHRIS'@'localhost' IDENTIFIED BY 'CHRISSEC';

set up a database and populated it with tables ad values, and granted the user CHRIS selected privileges using the command:

GRANT SELECT
ON PLAYERS
TO CHRIS;

and then I logged out. However, next time when I tried to login, the password "CHRISSEC" didn't work, and I had to use the old password "Y" to login. Also two different users may have the same password, so just asking the password alone cannot let the database know which user is actually trying to log in. So how to make the database prompt with a required username and password, upon which only those privileges granted to him before will be available to him and nothing else?

 
1
 

Did you tried this?

mysql -uCHRIS -pCHRISSEC
 
0
 

Yeah yeah, I did and now it is working fine. There were some problems with the installation, that's why it wasn't working. Thanks.

Question Answered as of 2 Years Ago by cereal
 
0
 

Ok, great!

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: