Change Password in Mysql5.7,
No password is set when mysql5.7 is installed in Ubuntu. mysql-u root-p cannot be used to connect to the mysql service.
There are two ways to query data online:
1. For the first installation, mysql5.7 sets a default password to be stored in a directory. After logging on with the default password, a prompt will be prompted to change the password. This method has not been tried yet
2. modify the mysql configuration file sudo vim/etc/mysql. conf. d/mysqld. cnf: add a line of skip-grant-tables under the [mysqld] segment and restart service mysql restart. Enter mysql. Press enter to skip permission verification and enter.
3. use mysql;
4. update mysql. user set authentication_string = password ('000000') where user = 'root ';
5. update user set plugin = "mysql_native_password ";
6. flush privileges;
7. quit;
8. Go back to step 2, delete the previously added sentence, and restart the service.
9. You can log on with the new password.