Monday, March 26, 2012

adding user to mysql on the command line

login to admin as root
go to start-->cmd prompt, type following command
c:>mysql - u root - p           (it will ask for the password)
Enter the password:****     (give the passworg which is generally root)

now you will inter into mysql command line interface

mysql> create user 'newuser'@'localhost';     (it will create you a new user which is myuser)

mysql> set password for 'newuser'@'localhost' =PASSWORD('myuser');
                                                                    (it will set the password for myser as myuser)

you can again login to the mysql with the create user as
 c:>mysql  -u newuser -p
Enter password:newuser 

No comments:

Post a Comment

java-8-streams-map-examples

package com.mkyong.java8; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; im...