Without access to mysql db (internal network)

I should config mysql db to accept remote accesses. Usually I edit my.cnf file to comment bind-address row. But in NethServer it doesn’t work. What can I do?

Hi,
You have your database within NethServer? if you want to access from outside your network to the database set up port forwarding.

for example

I have a workstation with mysql and to access the database from a web system outside my network, just configured, an object in the firewall, and redirect access ports.

PD: It is my case.

regards

mySQL by default does’t accept connections from remote host (in LAN too) but only from localhost. I should connect to mySQL in NethServer from other PCs inside my LAN. To do this, usually, in a lot of distro, I must comment a row in my.cnf config file but in NethServer it doesn’t work.

you created a user for remote access to the database?

GRANT ALL PRIVILEGES ON . TO user@’%’ IDENTIFIED BY ‘password’;
FLUSH PRIVILEGES;

I’m using admin user with full rights. It works in local console but it doesn’t work in remote. For example with WorkBench I get this error message: Host ‘192.168.1.21’ is not allowed to connect to this MySQL server. This error message is the same that usually I get when I try to connect to a Ubuntu Server before changing my.cnf file for the reasons explained above.

Assuming that all is well with the privileges in the mysql users.

How you have configured the firewall with the communication port to your database

Are you speaking about NethServer firewall? Because mySQL server (inside NethServer) and PCs are in the same LAN so any hardware firewall can block connections.

I do not understand, you can not access your database outside your local network or internal network?

Internal network

Ok bad title. Db to accept remote accesses.

Please create a service object firewall to port your mysql database, create an object with the IP address of your NethServer (MySQL Server), then create an access policy on the firewall, green network to the firewall object created with the service (port used by mysql)

try that

Where and how can I create a service object firewall? Inside NethServer? Thanks








performs this test and comment us

Now I understand, but I haven’t installed any firewall on NethServer so any role block input/output traffic. Must I install it however to create a role for mySQL? Are you sure?

Thanks again

Ports where you would have access without installing firewall would be one of these:

How you can see mySQL port (3306) is open for green interface and green interface is for LAN PCs. NethServer User’s Guide tell me that firewall/gateway mode is on only if I install nethserver-firewall-base, but I haven’t installed it.

So it’s good when requesting support us all the information about the case to guide better, now well how you have configured my.cnf? send us information

I performed a clean install of mysql in NethServer and everything works fine:

I did not have to edit my.cnf

There is something wrong with your configuration

How can you see I can’t edit my.cnf as I do usually with other distro because in the first line of the file there is written: DO NOT MODIFY THIS FILE Manual changes will be lost when this file is regenerated.

When I find this message usually there is written what I must edit instead of this file, but here there isn’t.

This is my my.cnf file. Usually I should add bind-address = * (see this link) but CentOS file is different from ubuntu (that I know better).

Thanks

[root@nethserver /]# cat /etc/my.cnf

================= DO NOT MODIFY THIS FILE =================

Manual changes will be lost when this file is regenerated.

Please read the developer’s guide, which is available

at

original work from

Copyright © 2013 Nethesis S.r.l.

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

max_allowed_packet=16M

networking is enabled

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

executed: show grants for your_user_created

Our mySQL installation is that performed automatically by NethServer when it installs from Software Center some applications as ownCloud. These applications work fine so I don’t think mySQL installation is bad, …, even if it doesn’t work :smile: