新安装的MySQL是默认不开户远程访问权限的,也就不能外部连接MySQL。这样对想远程调用MySQL的数据很不方便。
下面我们来看下如何设置允许远程连接MySQL数据库。
登录MySQL
mysql -uroot -p
grant all privileges on *.* to 'root'@'%' identified by '123456';
flush privileges;
exit;
下面我们来看下如何设置允许远程连接MySQL数据库。
登录MySQL
mysql -uroot -p
grant all privileges on *.* to 'root'@'%' identified by '123456';
flush privileges;
exit;