raspdroid
Posts: 1619
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: España

MariaDB escuchar en el puerto 3306/tcp

Tue Jan 31, 2017 11:46 am

Hola,

Tengo una instalación de MariaDB que solo escucha en el puerto 3306 pero tcp6 y no tcp y en my.cnf no hay nada.

Code: Select all

netstat -tlpn | grep mysql
tcp6       0      0 :::3306                 :::*                    LISTEN      14756/mysqld


nano /etc/mysql/my.cnf
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
nano /etc/mysql/conf.d/mysql.cnf
[mysql]

nano /etc/mysql/conf.d/mariadb.cnf
# MariaDB-specific config file.
# Read by /etc/mysql/my.cnf

[client]
# Default is Latin1, if you need UTF-8 set this (also in server section)
#default-character-set = utf8

[mysqld]
#
# * Character sets
#
# Default is Latin1, if you need UTF-8 set all this (also in client section)
#
#character-set-server = utf8
#collation-server = utf8_general_ci
#character_set_server = utf8
#collation_server = utf8_general_ci
Dónde se supone que hay que añadir bind-address=192.168.1.X ?

Con eso debería de bastar para que escuche en tcp4

Saludos
Last edited by raspdroid on Tue Jan 31, 2017 12:00 pm, edited 2 times in total.

raspdroid
Posts: 1619
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: España

Re: MariaDB escuchar en el puerto 3306/tcp

Tue Jan 31, 2017 11:58 am

Pues añadí bind-address=0.0.0.0 debajo de [mysqld] y port=3306 debajo de [client] en /etc/mysql/conf.d/mariadb.cnf y systemctl restart mysql.service y ahora cambió tpc6 por tcp ahora sí, pero no me deja una determinada ip solo 0.0.0.0

Code: Select all

nano conf.d/mariadb.cnf 
root@raspberrypi:/etc/mysql# netstat -tlpn | grep mysql
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      6367/mysqld 
¿Alguna idea de como hacer para que solo escuche en una determinada ip?

Saludos

Return to “Español”