Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to change the password of the MySQL account?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 235
    Comment on it

    There are different ways to change the password of MySQL account. They are:

    1. Changing password using UPDATE statement:
    2. For this you need to go to the User table of mysql database. To change password you need to execute the following commands:

      USE mysql;
      
      UPDATE user 
      SET password = PASSWORD('your_password')
      WHERE user = 'username' AND 
            host = 'hostname';
      
      FLUSH PRIVILEGES;
      

      For example:

      UPDATE user 
      SET password = PASSWORD('your_password')
      WHERE user = 'root' AND 
            host = 'localhost';
      
    3. Changing password using set password:
    4. SET PASSWORD FOR 'username'@'hostname' = PASSWORD('your_password')
      
    5. Changing password using GRANT USAGE statement:

    Following statement is used to change the mysql account password :

    GRANT USAGE ON *.* TO username@hostname IDENTIFIED BY your_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: