#1. Stop the MySQL database/etc/init.d/mysqld stop #2. Execute the following command mysqld_safe --user=mysql --skip-grant-tables --skip-networking & #3. Log in to the MySQL database mysql -u root mysql #4 using root. Update Root password mysql> update user set authentication_string = password ( ' New-password ' ) WHERE User = ' root ' ; #5. Refresh Permissions mysql> FLUSH privileges; #6. Exit mysqlmysql> quit #7. Restart the mysql/etc/init.d/mysqld restart #8. Use the root user to log back in mysqlmysql -uroot -p enter password: < Enter the new password newpassword> --prompt error 1819 (HY000) When changing password: your password does not satisfy the current policy requirements need to modify the value of Validate_password_policy:mysql> set global validate_password_policy=0; see mysql> select @ @validate_password_length; -- When uninstalling MySQL hint Error reading informAtion on service mysqld: invalid argument can use the command: rpm -e --nopreun -- nopostun --nodeps mac mysql error you must reset your password using alter user statement before executing this Statement. After installing mysql , after landing, regardless of running any command, always prompt this step 1: set password = password ( ' Your new password '); step 2: alter user ' root ' @ ' localhost ' password EXPIRE NEVER; step 3: flush privileges;
MySQL Modify user password!