Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create user in MySQL Database?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 242
    Comment on it

    Whenever you create a new user in MySQL it wiil stored in the User table of mysql database. There are two ways to create users:

    1. Create user statement:
    2. CREATE USER username@hostname 
      IDENTIFIED BY 'password'
      

      For example:

      CREATE USER root@localhost 
      IDENTIFIED BY 'root'
      

      It will create a user 'root' in localhost with 'root' as password.


    3. Using INSERT statement:
    use mysql;
    
    INSERT INTO user (host,user,password)
    VALUES('username','username',PASSWORD('password'));
    For example:
    INSERT INTO user (host,user,password)
    VALUES('localhost','root',PASSWORD('root'));
    

    It will create a user 'root' in localhost with 'root' as password.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: