mysql: switch user
Posted by: paviraghu (117.192.41.---)
Date: October 03, 2012 07:22AM

FYI,


I want to know how to switch user from the root, i have created the user with password and granted permissions for that user, i need to change the user

i tried

mysql> mysql -uusername -ppassword

Error message:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax

please help me, its very much required.

Options: ReplyQuote
Re: mysql: switch user
Posted by: RiggsFolly (---.as13285.net)
Date: October 03, 2012 04:05PM

If you actually created a mysql userid then the syntax you entered should work!

How did you create the new user?

Options: ReplyQuote
Re: mysql: switch user
Posted by: paviraghu (117.192.39.---)
Date: October 04, 2012 06:12AM

I created the user using

create user 'username'@'localhost' identified by 'password';

Options: ReplyQuote
Re: mysql: switch user
Posted by: stevenmartin99 (Moderator)
Date: October 04, 2012 06:18AM

What's the issue?


The command is

mysql -uUSERNAME -p

you must do this from command prompt in the mysql/bin folder.


You cannot do it in the mysql console as you are already logged in as root.

To change the user the console opens with open

C:/wamp/wampmanager.tpl

Search for root and replace with your username

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: mysql: switch user
Posted by: paviraghu (117.192.39.---)
Date: October 04, 2012 07:11AM

Thanks a lot it worked....

Options: ReplyQuote
Re: mysql: switch user
Posted by: RiggsFolly (---.as13285.net)
Date: October 04, 2012 10:20AM

If you had said you were using the MySQL Console in the first post that would of helped( just a bit )

Options: ReplyQuote


Sorry, only registered users may post in this forum.