mysql服务器设置对外访问权限的方法
1.首先,在命令行中启动mysql服务;
Linux:service mysql start
Windows:net start mysql
2.mysql服务启动后,在命令行中输入mysql的用户名和密码,登录到mysql;
mysql -u root -p
3.登录到mysql后,在mysql中开启对外访问权限;
#允许任意用户远程访问到mysql
GRANT ALL PRIVILEGES ON *.* TO 'bd'@'%' IDENTIFIED Y 'bdpw' WITH GRANT OPTION;
#允许特定IP地址的用户远程访问到mysql
GRANT ALL PRIVILEGES ON *.* TO 'bd'@'172.16.4.198' DENTIFIED BY 'bdpw' WITH GRANT OPTION;
4.最后,对外访问权限设置好后,对授权表进行更新,权限即可生效;
FLUSH PRIVILEGES;