- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does % stand for in host column and how to change user's password?
The localhost means you can access from same machine while from % the remote host access is possible. The syntax is as follows to change the user password.
SET PASSWORD FOR 'yourUserName'@'localhost' ='yourPassword';
First check the user and host from MySQL.user table. The query is as follows −
mysql> select user,host from MySQL.user;
Here is the output −
+------------------+-----------+ | user | host | +------------------+-----------+ | Bob | % | | Manish | % | | User2 | % | | mysql.infoschema | % | | mysql.session | % | | mysql.sys | % | | root | % | | @UserName@ | localhost | | Adam Smith | localhost | | James | localhost | | John | localhost | | John Doe | localhost | | User1 | localhost | | am | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | +------------------+-----------+ 16 rows in set (0.01 sec)
Now, let us change the password for user ‘John’. The query is as follows −
mysql> SET PASSWORD FOR 'John'@'localhost' ='John123456'; Query OK, 0 rows affected (0.35 sec)
After that you need to set the flush privileges. The query is as follows −
flush privileges;
- Related Articles
- How do I change a MongoDB user's password?
- How to change the password in MongoDB for existing user?
- How to change the local user account password using PowerShell?
- What does AMUL stand for?
- How to Force User to Change Password at Next Login in Linux?
- Resolve error 1045 (28000) access denied for user 'root'@'localhost' (using password: YES)?
- How can we change MySQL user password by using the SET PASSWORD statement?
- What does Q in LGBTQ stand for?
- How can we change MySQL user password by using the ALTER USER statement?
- Encryption Vs Password Protection: What's the Difference?
- What does the native in Java stand for?
- How can we change MySQL user password by using UPDATE statement?
- How to get a Docker container's IP address from the host?
- How to change JTable's header font in Java
- How To Change UIView's Border Color And Thickness in Cocoa Touch?

Advertisements