Labels

Monday, 7 November 2016

How to update the user or anyonymous password in MySQL

How to Change password with mysqladmin
mysqladmin - u root - p password "new password"
Change your password to pwd5 for the user account under which you're currently logged on to the system
SET PASSWORD = PASSWORD('pwd5'); 
Connect to the server at a specific IP address, with a username of myname and password of mypass:
shell> mysql host=192.168.1.33 user=myname password=mypass
shell> mysqladmin -u root password 'rootpass'
shell> mysqladmin -u root -h host_name password 'rootpass'
shell> mysql -u root mysql
If you want to assign passwords to the anonymous accounts
UPDATE user SET Password = PASSWORD('anonpass') WHERE User = '';
UPDATE user SET Password = PASSWORD('rootpass') WHERE User = '' AND Host = 'localhost';

No comments:

Post a Comment