注意:以管理员身份打开命令提示符
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
原文地址:https://www.cnblogs.com/zjp119/p/12394697.html
时间: 2024-10-08 01:31:37