Monday, December 14, 2015

Ubuntu Lamp accessing mysql from outside




I installed this LAMP: https://github.com/teddysun/lamp



Everything is perfectly setup, I still have to access mysql from outside, I was expecting to find the usual bind-address in mysql config file:



[mysqld]
bind-address = 127.0.0.1


In looking inside the /etc/my.cnf I cannot find any bind-address variable.




I've checked as well into /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf but the are all not-existent file.



Edit



This is the full config:



[mysql]

# CLIENT #

port = 3306
socket = /tmp/mysql.sock

[mysqld]

# GENERAL #
port = 3306
user = mysql
default-storage-engine = InnoDB
socket = /tmp/mysql.sock

pid-file = /usr/local/mysql/data/mysql.pid
skip-name-resolve
skip-external-locking

# MyISAM #
key-buffer-size = 32M

# INNODB #
innodb-log-files-in-group = 2
innodb-log-file-size = 64M

innodb-flush-log-at-trx-commit = 2
innodb-file-per-table = 1
innodb-buffer-pool-size = 256M

# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 256

thread-cache-size = 50
open-files-limit = 1024
table-open-cache = 400


# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000

# DATA STORAGE #

datadir = /usr/local/mysql/data

# LOGGING #
log-error = /usr/local/mysql/data/mysql-error.log


Is there a specific/different setup for this LAMP script?


Answer



When not specifically defined the bind-address defaults to *





If the address is *, the server accepts TCP/IP connections on all server host IPv6 and IPv4 interfaces if the server host supports IPv6, or accepts TCP/IP connections on all IPv4 addresses otherwise. Use this address to permit both IPv4 and IPv6 connections on all server interfaces. This value is the default.



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...