MySQL command-line as user other than 'root'
Posted by: LaityDev (---.hsd1.wa.comcast.net)
Date: January 25, 2012 02:15PM

I'm just starting with MySQL and am experimenting with user permissions. I've created a new user on my local machine called 'sampadm' with password 'secret' as per my textbook's tutorial. Accessing the MySQL command line from the system tray prompts me with the 'root' password without first offering the option for other users. Additionally, when accessing the 'mysql.exe' file (which is the MySQL command-line executable within the mysql bin) I get an error for not having access as 'ODBC'. I understand why this is, but how do I work with it?

What I'm asking is: how do you access the MySQL command-line with an account other than root, and can the solution somehow be implemented in such a way to allow for shortcuts/launch-modifiers? A preferable alternative (if possible) would to have access to the Apache command-line so I could just type "% mysql -p -u sampadm", but I know nothing of Apache or how it is set up with this package.

Options: ReplyQuote
Re: MySQL command-line as user other than 'root'
Posted by: infopeer (220.224.230.---)
Date: January 30, 2012 09:46AM

Browse to Bin directory from command line & specify as below

C:\wamp\bin\mysql\mysql5.5.8\bin>mysql -sampadm -psecret

let me know how this works.

Thanks

Founder & Administrator
[www.infopeer.com]
[www.zaadu.com]

Options: ReplyQuote
Re: MySQL command-line as user other than 'root'
Posted by: stevenmartin99 (---.251.255.11.threembb.ie)
Date: January 30, 2012 12:23PM

Close smiling smiley

Its

MySQL -uUSERNAME -p

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

Options: ReplyQuote
Re: MySQL command-line as user other than 'root'
Posted by: RiggsFolly (---.as13285.net)
Date: January 31, 2012 01:13PM

You can change the user that will be used by clicking on the MySQL->MySQLConsole by making a change to the wampmanager.ini file in your X:\WAMP folder.

Look for this section in wampmanager.ini

[mysqlMenu]
...
...
FileName: "D:/wamp/bin/mysql/mysql5.X.Y/bin/mysql.exe";Parameters: "-u sampadm -p"; Glyph: 0
...
...
;WAMPMYSQLMENUEND

Change [root] to your new id i.e. sampadm as I have done above.


Note: the version number of the mysql folder will depend on what version you are running.

Options: ReplyQuote
Re: MySQL command-line as user other than 'root'
Posted by: trumpman (---.hsd1.ca.comcast.net)
Date: June 05, 2012 06:55AM

It appears that "wampmanager.ini" is updated (at least for certain sections/lines) from "wampmanager.tpl" upon WAMP invocation. So you may need to make RiggsFolly's mod there instead. Don't forget to make a copy of "wampmanager.tpl" before you make any mods.



Edited 1 time(s). Last edit at 06/05/2012 06:58AM by trumpman.

Options: ReplyQuote
Re: MySQL command-line as user other than 'root'
Posted by: mesinhosting (114.79.50.---)
Date: June 22, 2012 10:44PM

try this:

startmenu -> run -> cmd

and type:

cd C:\wamp\bin\mysql\mysql5.5.24\bin

login to mysql with root username

type:
mysql -uroot -p
or
mysql -uroot
if you haven't set the password for the root user

then you must create the user with the root permission before you can use the username.

type this in the command line windows

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

grant all privileges on *.* to 'username'@'localhost' identified by 'password' with grant option max_updates_per_hour 0 max_connections_per_hour 0 max_queries_per_hour 0 max_user_connections 0;

exit;

now should can login with the 'username' and the password 'password'

you also can customizing the privileges like update,delete,select on databasename.* to the username.

www.mesinhosting.com



Edited 1 time(s). Last edit at 06/22/2012 11:04PM by mesinhosting.

Options: ReplyQuote


Sorry, only registered users may post in this forum.