刚安装的mysql不支持远程连接,如果需要远程连接需要在mysql运行如下命令。
登录到mysql
grant all on *.* to 'root'@'%' identified by '111111';
flush privileges;
执行以上两条命令即可,其中root为mysql连接时用户名,111111为密码。
以下是查看设置结果的命令。
use mysql;
select user,password,host from user;
刚安装的mysql不支持远程连接,如果需要远程连接需要在mysql运行如下命令。
登录到mysql
grant all on *.* to 'root'@'%' identified by '111111';
flush privileges;
执行以上两条命令即可,其中root为mysql连接时用户名,111111为密码。
以下是查看设置结果的命令。
use mysql;
select user,password,host from user;