Home >Database >Mysql Tutorial >mysql设置允许外部访问的方法_MySQL

mysql设置允许外部访问的方法_MySQL

WBOY
WBOYOriginal
2016-06-01 13:43:181242browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn