1) if you have not forgotten the password, you can use UPDATE to directly edit the user table to change the password: Enter the database mysql-urootmysqlgt; usemysql; mysql
1) if you have not forgotten the password, you can use UPDATE to directly edit the user table to change the password: Enter the database mysql-u rootmysqlgt; use mysql; mysql
1) if you have not forgotten the password, you can use UPDATE to directly edit the user table to change the password:
Enter mysql-u root
Mysql> use mysql;
Mysql> UPDATE user SET Password = PASSWORD ('newpass') WHERE user = 'root ';
Mysql> flush privileges;
Or
/Etc/init. d/mysql stop
/Etc/init. d/mysql start
2) If you have forgotten your password:
#/Etc/init. d/mysql stop 1. End the currently running mysql process.
#/Usr/bin/mysqld_safe -- skip-grant-tables 2. Run in mysql security mode and skip permission verification.
# Mysql-u root 3. restart a terminal to log on to mysql as the root user.
Mysql> use mysql; 4. Modify the root user password.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with-
Database changed
Mysql> update user set Password = PASSWORD ('root') where User = 'root ';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
Mysql> exit
#/Etc/init. d/mysql restart 5. End mysql security mode and run mysql in normal mode.
Mysql> update mysql. user set password = PASSWORD ('new password') where User = 'root ';
6. Try your new password.
Mysql> flush privileges;
Mysql> quit
,