SIDEBAR
»
S
I
D
E
B
A
R
«
Adding new user to MySQL server
November 4th, 2009 by Mojtaba

In Order to add a new user to MySQL server from command-line you have to do the following!

First you have to connect to MySQL server as root

mysql --user=root mysql

After connecting to the server as root you can create new user with CREATE USER command then set privileges by GRANT command.
Let’s create a new user for “administrator” and grant it to all privileges. I uses the ‘%’ wildcard for the host part, so it can be used to connect from any host. If you want to restrict access from other machines you can user ‘localhost’ as host part.


CREATE USER 'administrator'@'%' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON *.* TO 'administrator'@'%' WITH GRANT OPTION;


Leave a Reply


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>




»  Substance:WordPress   »  Style:Ahren Ahimsa
© 2010 Mojtabacazi.com . All right reserved