Home > Database > Mysql Tutorial > body text

局域网内连接MySQL_MySQL

WBOY
Release: 2016-06-01 13:45:51
Original
1241 people have browsed it

bitsCN.com

在局域网内连接MySQL首先要给MySQL开启远程连接的功能,在MySQL服务器上MySQL命令行执行以下命令:

Sql代码

grant all privileges on *.* to root@"%" identified by '123' with grant option;

flush privileges;

它的意思是给从任意ip地址连接的用户名为root,密码为123的用户赋予所有的权限。其中的"%"为任意的ip地址,如果想设为特定的值也可以设定为特定的值。

执行了该语句后就可以在其他机器上以root:123访问到该机器上了

bitsCN.com
Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!