When docker installed Zipkin to save the specified data to mysql, I encountered a problem:
java.sql.SQLException: Host 'DESKTOP-CDSCUCH' is not allowed to connect to this MySQL server
docker-compose.yml
version: '2'
services:
zipkin:
image: openzipkin/zipkin
container_name: zipkin
environment:
- STORAGE_TYPE=mysql
- MYSQL_DB=zipkin
- MYSQL_USER=root
- MYSQL_PASS=123456
- MYSQL_HOST=10.10.0.166
- MYSQL_TCP_PORT=3306
ports:
- 9411:9411
Solution
1. Modify the database
to find the user table of the mysql database, will be localhost
replaced%
Method 2. Log in to mysql to execute
use mysql
grant all PRIVILEGES on test_db.* to root@'10.10.0.166' identified by '123456';
Finally solved
mysql> FLUSH PRIVILEGES;