Home  >  Article  >  Database  >  开启MySQL远程访问权限

开启MySQL远程访问权限

WBOY
WBOYOriginal
2016-06-07 17:28:10968browse

最近数据库迁移,研发的tomcat要以其他用户访问数据库,需要开启远程访问权限; 并且我们知道远程访问Mysql有两种方法,授权发和

最近数据库迁移,研发的tomcat要以其他用户访问数据库,,需要开启远程访问权限;

并且我们知道远程访问Mysql有两种方法,授权发和改表法;

开启MySQL远程访问权限

呵呵,图字是已经开启slave的帐号,

可以看到已经有了root用户,host列可以是hostlist或IP;可以修改域名或IP==;

1\授权法:

use mysql;

grant all privileges  on *.* to leo@'%' identified by "leo";

以leo用户在任何地方都可以访问;

2\该表法:

可以实现以root用户在任何地方访问数据库

update user set host = '%' where user = 'root';

这样就可以了

linux

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
Previous article:MySQL::SandboxNext article:Oracle 11g新函数全攻略