tony2001 / pinba_engine

Pinba - MySQL plugin and storage engine
http://pinba.org
GNU General Public License v2.0
478 stars 41 forks source link

Host '172.18.0.1' is not allowed to connect to this MySQL server #64

Closed alexanderilyin closed 5 years ago

alexanderilyin commented 6 years ago

Looks like MySQL is not configured properly to be used out of the box.

docker-compose.yml

version: '3.2'
services:
  pinba:
    image: tony2001/pinba:latest
    ports:
      - target: 3306
        published: 3306
        protocol: tcp
        mode: host
      - target: 30002
        published: 30002
        protocol: udp
        mode: host

telnet

AF6428:docker-nginx-pinba ailyin$ telnet localhost 3306
Trying ::1...
Connected to localhost.
Escape character is '^]'.
CHost '172.18.0.1' is not allowed to connect to this MySQL serverConnection closed by foreign host.
g3rhard commented 5 years ago

Because you must add user like this:

docker exec -it pinba /local/mysql/bin/mysql -u root -p GRANT ALL PRIVILEGES ON 'pinba'.* TO 'pinba'@'%' IDENTIFIED BY 'PASSWORD'; And connect to pinba via mysql -H localhost -P 3306 -u pinba -p'PASSWORD'

alexanderilyin commented 5 years ago

Yep. This was done on my side by overriding docker entry point. Once I clean up current configuration for Pinba2 I’ll create a PR to new repo.