How to access new user Accounts, it always logs into my Root

Reply

Join Date: Mar 2009
Posts: 13
Reputation: andrewsCWD is an unknown quantity at this point 
Solved Threads: 0
andrewsCWD andrewsCWD is offline Offline
Newbie Poster

How to access new user Accounts, it always logs into my Root

 
0
  #1
Mar 21st, 2009
Hello,

The problem is I have made a second user account for my databases, every time I open the MySql monitor it doesn't prompt me for a username, it just assumes I want to log into the Root and asks for my Root password. It doesnt ask for a username or which username I want to log in under.

I assumed that when I opened the mysql monitor it should prompt me to enter something like:

  1. mysql -u username -p

but it just goes directly to my root, no username questions.

This is just a localhost install of mysql on my PC.

Thanks for any help.

Andrew
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: How to access new user Accounts, it always logs into my Root

 
0
  #2
Mar 22nd, 2009
How do you enter the MySQL shell/monitor ?
If you type just mysql and fire the command it will assume the default settings in the my.cnf (GNU Linux)/ my.ini (Windows) configuration file.

If there's something different that you are doing then specify it.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 13
Reputation: andrewsCWD is an unknown quantity at this point 
Solved Threads: 0
andrewsCWD andrewsCWD is offline Offline
Newbie Poster

Re: How to access new user Accounts, it always logs into my Root

 
0
  #3
Mar 22nd, 2009
Hi verruckt24,

Thanks for trying to help. I must not have explained properly.

I was setting up user names and passwords for the MySQL database to give those usernames certain access to parts of the database.

I'm trying to figure out how to login to those new usernames. Because when I open the mysql monitor it goes right to the Root user, it doesnt ask me to sign in, it only prompts me for the Root password. It should be asking which username wants to log in.

Is that clearer? Thanks for your help.

Andrew
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: How to access new user Accounts, it always logs into my Root

 
0
  #4
Mar 23rd, 2009
MySQL monitor - this is the command shell of MySQL that you are talking about isn't it ? Just to make sure we are on the same wavelength here.

Also have you already created the users or are you in the process of creating them.

Third, what command do you use to login ?

The actual procedure should be something like:
1. Login using the root user
2. Create users with 'Create user...' or 'Grant'
3. Logout of the shell.
4. Try to login with the given username/password.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 13
Reputation: andrewsCWD is an unknown quantity at this point 
Solved Threads: 0
andrewsCWD andrewsCWD is offline Offline
Newbie Poster

Re: How to access new user Accounts, it always logs into my Root

 
0
  #5
Mar 25th, 2009
Yes, the MySQL monitor is what I'm talking about.

Yes, I have created the user already and gave that user account privileges to a certain database.

For the third question you asked about how I login: I just open the MySQL monitor and it instantly prompts me for the root password. I enter it and I'm in.

Your procedure that you gave was very helpful. So I guess I understand my problem now of why it's not prompting a user name first.

No matter what I have to give that user access to the Root password? and then that user has to log in to his user name right?

I thought the point of creating user accounts was so that they can't access everything in the root, I only want them to be accessing what I give them privileges too. By giving them the root password so they can log in to their user account, doesn't that give them access to everything before they log in to their user account?

This is very confusing, or I'm making harder than it is haha. Thanks for your help.

Andrew
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: How to access new user Accounts, it always logs into my Root

 
0
  #6
Mar 26th, 2009
Same passwords would not cause the root privileges to be given to the user. As privileges are given to user accounts and not to passwords.

2. Create users with 'Create user...' or 'Grant'
You can give the user account a password at the time of creating the user account. Read the CREATE USER syntax in MySQL documentation (MySQL Reference Manual) Or you could set the password with SET PASSWORD Read this in the documentation too. Or you could set the password with the GRANT command itself the command should be like this
  1. GRANT SELECT, UPDATE, DELETE on database.tablename to user@host IDENTIFIED BY 'password';

Here,
database - database on which to give permission to.
tablename - tablename on which to give permission to.
user - username
host - machine (localhost, domain-name or IP)
password - password that you want toassign to the user account.

Replace these values in the command as per your requirements. Read the GRANT command too in the docs.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MySQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC