Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logging in as a different user on MySQL

Tags:

mysql

I created a different user, when I try to log into mysql it will not let me. I think I am missing a step. I am using windows 7. When I log in it automatically asks me for a password. If I enter the root password I can use mysql. If I enter the password I have created for the user, I get an error I cannot read and the program exits. Do I need to first login as root then somehow log in as new user. I am very confused. The code I used to create the new user is here:

Trouble logging into mysql as non root

like image 981
Aaron Avatar asked Apr 16 '11 23:04

Aaron


People also ask

How do I login as a different user in MySQL?

If you want to login as a different user on MySQL, you need to use “mysql -u -p command”. The syntax is as follows to login as a different user.

How do I switch users in MySQL workbench?

Within the connection tab, do one of the following: Click Users and Privileges from the Management list within the Navigator area. Click Server and then Users and Privileges from the menu.


1 Answers

Try this:

>> mysql -u USERNAME -p 

Press enter, and you'll be prompted for the password for USERNAME.

like image 143
Zach Rattner Avatar answered Oct 23 '22 14:10

Zach Rattner