Home  >  Article  >  Database  >  如何设置才能远程登录Mysql数据库

如何设置才能远程登录Mysql数据库

WBOY
WBOYOriginal
2016-06-07 16:28:181131browse

可以在一台机器上访问另一台机器的MySQL,但是需要一些设置。 进入MySQL后,输入以下命令: GRANT ALL PRIVILEGES ON *.* TO 'tigase'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; 允许任何主机以tigase为用户名(root用户不能远程登录,只能本地登录)

可以在一台机器上访问另一台机器的MySQL,但是需要一些设置。

进入MySQL后,输入以下命令:

GRANT ALL PRIVILEGES ON *.* TO 'tigase'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

允许任何主机以tigase为用户名(root用户不能远程登录,只能本地登录),123456为密码访问MySQL。

flush privileges;

让MySQL重新加载权限,使赋予的权限能够马上生效。

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