Home >Database >Mysql Tutorial >fedora 16 mysql远程连接_MySQL

fedora 16 mysql远程连接_MySQL

WBOY
WBOYOriginal
2016-06-01 13:49:21993browse

Fedora

bitsCN.com

  默认情况下,mysql只能本地登陆。

  如果需要远程连接,需要在root下创建一个账号。

格式如:grant all privileges on  *.* to abc123@"#" identified by "password";

'%' 表示任何ip都可以登陆,如过希望特定ip登陆,可以指明特定的ip。

 

在fedora 16 中,默认3306端口是关闭的,我们需要打开端口才能进行登陆。

vi /etc/sysconfig/iptables

添加如下字符串

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

重启iptables即可连接。

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