Home > Database > Mysql Tutorial > 授权远程连接MySQL(Linux)_MySQL

授权远程连接MySQL(Linux)_MySQL

WBOY
Release: 2016-06-01 12:59:54
Original
1013 people have browsed it

MySQL远程访问的命令 格式: mysql -h主机地址 -u用户名 -p用户密码

首先在目标服务器上(115.159.66.51)修改mysql的my.cnf文件:
这里写图片描述

这里写图片描述数据库):
grant all privileges on haibao.* to ‘root’@’115.159.66.51’ identified by ‘xiongchao’ with grant option;

赋予任何主机以root的身份访问数据权限(注:访问haibao数据库):
grant all privileges on haibao.* to ‘root’@’%’ identified by ‘xiongchao’ with grant option;

修改生效:
flush privileges;

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template