We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,442 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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

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?

2
Contributors
3
Replies
3 Days
Discussion Span
1 Year Ago
Last Updated
4
Views
Question
Answered
Cupidvogel
Light Poster
25 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Did you tried this?

mysql -uCHRIS -pCHRISSEC
cereal
Veteran Poster
1,146 posts since Aug 2007
Reputation Points: 344
Solved Threads: 223
Skill Endorsements: 22

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.

Cupidvogel
Light Poster
25 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by cereal

Ok, great!

cereal
Veteran Poster
1,146 posts since Aug 2007
Reputation Points: 344
Solved Threads: 223
Skill Endorsements: 22

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.5162 seconds using 2.65MB