Mysql Server On Debian Allows Access To Others

Debian系统下的mysql server默认配置下是不允许来自其他终端的数据库连接的,需要更下以下模块:

1. Set bind address as open status to the specified points, if local, you may set it as 0.0.0.0 (it means to all points)

/etc/mysql/mysql.conf.d/mysqld.conf

[mysqld]
bind-address = 0.0.0.0

2. Open port 3306 to be accessed

ivan@ivan sudo /sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
ivan@ivan sudo iptables-save

3. Create user and give it grant option

mysql> create user 'ivan'@'localhost' identified by '...';
mysql> grant all privileges on *.*  to 'ivan'@'localhost' with grant option;
mysql> create user 'ivan'@'%' identified by '...';
mysql> grant all privileges on *.* to 'ivan'@'%' with grant option;
mysql> flush privileges;

 

 

 

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>