 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can we change MySQL user password by using the SET PASSWORD statement?
We can use SET PASSWORD statement to change the password. Before using this command, we need to have at least UPDATE privileges. Its syntax would be as follows −
Syntax
SET PASSWORD FOR ‘user_name@host_name’=new_password;
Here, New_password would be new password we want to set for MySQL user
User_name is the name of the current user.
Host_name is the name of the host of the current user.
Example
Suppose if we want to change the password user@localhost to ‘tutorials’ then it can be done as follows −
SET PASSWORD FOR ‘user@localhost’= tutorials;
Advertisements
 