Heim >Datenbank >MySQL-Tutorial >mysql设置允许外部访问的方法_MySQL
bitsCN.com
配置外部访问帐号密码
本地登录mysql
Java代码 mysql -uroot -p 执行Java代码 grant all on *.* to rails@'client_ip' identified by 'password' with grant option; 例子:所有局域网客户端都可访问Java代码 grant all on *.* to root@'192.168.0.%' identified by 'root' with grant option; 例子:为boyu数据库设置用户boyuJava代码 grant all on boyu.* to boyu@'192.168.0.%' identified by 'p4ssword'; app_server_id为APP应用服务器的IP 设置mysql外部能访问/etc/mysql/my.cnf注释到下面这行Java代码 bind-address = 127.0.0.1 重启mysql-serverJava代码 sudo service mysql restart 作者 clark1231 bitsCN.com