There is no password in MySQL 5.7, and it has been changed to authentication_ string
update mysql.user set authentication_string=password('root') where user='root' ;
The complete way to change MySQL password is as follows:
1.vim /etc/my.cnf [mysqld] add skip-grant-tables
2./etc/init.d/mysqld restart
3.Type mysql in the terminal to log in directly to the MySQL database, and then use mysql
4.update mysql.user set authentication_string=password('root') where user='root' ;
5.flush privileges;
6.quit;
7.Edit /etc/my.cnf to remove skip-grant-tables, then restart MySQL /etc/init.d/mysqld restart
8. mysql -u root -p and enter the password to log in to the MySQL database
In the old version, the command to change the password is as follows: mysql5.7 password is changed to authentication_ string
mysql> update user set password=password(“new password”) where user=”username”;
Similar Posts:
- MYSQL Login Error: mysqladmin: connect to server at ‘localhost’ failed
- [Solved] MYSQL Install and Login Error: Access denied for user ‘ODBC’@’localhost’ (using password: NO)
- [Solved] Access denied for user ‘ODBC’@’localhost’ (using password: NO)
- mysql ERROR 1044 (42000): Access denied for user ‘
- Mysqldump backup problems got error: 1045, error 1045 (28000), got error: 1449
- [Solved] Mysql 5.7 Change Passwords ERROR 1054 (42S22): Unknown column ‘password’ in ‘field list’
- Linux Login MYSQL Error: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- [Solved] MYSQL ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘mysql’
- MySQLAccess denied for user ‘root’@’localhost’ [How to Solve]
- [Solved] MYSQL ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘mys…