mysql中修改密码的操作

注意:以管理员身份打开命令提示符

1登入并修改密码(在mysql.exe所在的bin目录中进行操作

F:\software\mysql-5.7.18-win32\bin>mysql -uroot -p //登录mysql

Enter password: ************ //密码就是输入的密码

2.设置mysql密码

mysql> set password=password(‘123456‘); //修改密码

Query OK, 0 rows affected, 1 warning (0.00 sec)

3. 授权远程登录

mysql> grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant option;

Query OK, 0 rows affected, 1 warning (0.00 sec)

 4.刷新

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

5.退出mysql

mysql> quit;

Bye

相关文章